Hi all,
I have been reading all posts but cant come across the answer.
I am using this code:
Sub createFolders()
Dim fpath As String
Dim i, xc As Integer
For i = 1 To ActiveSheet.UsedRange.Rows.Count
xc = Range("XFD" & i).End(x1ToLeft).Column
If xc = 1 Then
fpath = Cells(i, xc).Value
Else
fpath = Cells(Cells(i, xc - 1).End(xlUp).Row, xc - 1).Value & "/" & Cells(i, xc).Value
Cells(i, xc).Value = fpath
End If
MkDir ("C:\Users\asharpe\OneDrive - ADCO CONSTRUCTIONS PTY LTD\Desktop\Make Folder" & fpath)
If Err.Number <> 0 Then
Err.Clear
End If
Next
End Sub
There appears to be an issue with the line in red.
I am trying to make folders within folders as per the example:
Any ideas?
Thanks in advance.
I have been reading all posts but cant come across the answer.
I am using this code:
Sub createFolders()
Dim fpath As String
Dim i, xc As Integer
For i = 1 To ActiveSheet.UsedRange.Rows.Count
xc = Range("XFD" & i).End(x1ToLeft).Column
If xc = 1 Then
fpath = Cells(i, xc).Value
Else
fpath = Cells(Cells(i, xc - 1).End(xlUp).Row, xc - 1).Value & "/" & Cells(i, xc).Value
Cells(i, xc).Value = fpath
End If
MkDir ("C:\Users\asharpe\OneDrive - ADCO CONSTRUCTIONS PTY LTD\Desktop\Make Folder" & fpath)
If Err.Number <> 0 Then
Err.Clear
End If
Next
End Sub
There appears to be an issue with the line in red.
I am trying to make folders within folders as per the example:
Folder
Inside
North
South
Park
Outside
East
Dog
Any ideas?
Thanks in advance.