• 导出sheet到新文件夹当中


    Sub 导出当前客户达成分析()
    Application.ScreenUpdating = False
    myName1 = Sheets("日期统计表").Range("B1") '客户名称
    myName = Sheets("配送明细报表").Range("BA2")
    mypath = ThisWorkbook.Path
    If Len(Dir(mypath & myName, vbDirectory)) < 1 Then
    MkDir mypath & "" & myName
    End If
    Sheets("日期统计表").Select
    Sheets("日期统计表").Copy
    ActiveSheet.Unprotect Password:=123
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
    ActiveSheet.Shapes.Range(Array("Button 1")).Select
    Selection.Delete
    Range("B1:C1").Select
    With Selection.Validation
    .Delete
    .Add Type:=xlValidateInputOnly, AlertStyle:=xlValidAlertStop, Operator _
    :=xlBetween
    .IgnoreBlank = True
    .InCellDropdown = True
    .InputTitle = ""
    .ErrorTitle = ""
    .InputMessage = ""
    .ErrorMessage = ""
    .IMEMode = xlIMEModeNoControl
    .ShowInput = True
    .ShowError = True
    End With
    ActiveWorkbook.SaveAs Filename:=mypath & "" & myName & "" & myName1 & ".xlsm", FileFormat _
    :=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
    ActiveWindow.Close
    Application.ScreenUpdating = True
    End Sub

  • 相关阅读:
    【数据结构与算法】C++Vector常用备忘
    【数据结构与算法】C++String常用备忘
    【JAVA】几个collection框架
    【JAVA】创建一维数组+创建二维数组
    DNN 错误代码 0x80070005 解决方案
    ehcache
    redis
    MySql优化—删除操作
    MySql优化过程及原理
    如何查看MySQL的执行计划
  • 原文地址:https://www.cnblogs.com/shida-liu/p/9243765.html
Copyright © 2020-2023  润新知