vba批量添加文件夹

Sub createFolder()
    
    Dim wks As Worksheet
    
    On Error Resume Next
    
    Set wks = ThisWorkbook.Worksheets(1)
    basepath = ThisWorkbook.Path & "\"
    Max = wks.Range("A100000").End(xlUp).Row
  
    For i = 2 To Max
   
        VBA.MkDir (basepath & wks.Cells(i, 1))
        
    Next
End Sub
Sub Auto_Open()
    Application.OnKey "+^{Right}", "createFolder"
End Sub

  

posted @ 2024-10-23 09:12  tec2019  阅读(4)  评论(0编辑  收藏  举报