Create a folder and sub folder in Excel VBA

后端 未结 13 1618
梦谈多话
梦谈多话 2020-11-28 05:43

I have a pull down menu of companies that is populated by a list on another sheet. Three columns, Company, Job #, and Part Number.

When a job is created I need a fo

13条回答
  •  天涯浪人
    2020-11-28 06:03

    Another simple version working on PC:

    Sub CreateDir(strPath As String)
        Dim elm As Variant
        Dim strCheckPath As String
    
        strCheckPath = ""
        For Each elm In Split(strPath, "\")
            strCheckPath = strCheckPath & elm & "\"
            If Len(Dir(strCheckPath, vbDirectory)) = 0 Then MkDir strCheckPath
        Next
    End Sub
    

提交回复
热议问题