(Solved) – Saving/checking path based on cell value


I am trying to figure out how to check a path and save based on cell value. I was hoping to get an idea of what I’m doing wrong.


Sub Macro1()
        Sub CreateDir(strPath As String)
        Dim elm As Variant
        Dim strCheckPath As String

    strCheckPath = Environ("USERPROFILE") & "DocumentsEdit Listings" & Worksheets("Private").Range("A10").Value & Worksheets("Private").Range("B10").Value & Worksheets("Private").Range("C10").Value
    For Each elm In Split(strPath, "")
        strCheckPath = strCheckPath & elm & ""
        If Len(Dir(strCheckPath, vbDirectory)) = 0 Then MkDir strCheckPath
End Sub

Leave a Reply

Your email address will not be published. Required fields are marked *