Goal: Need Folders to match names in Column C of Spreadsheet
IF Folder Exists. Do nothing
IF Folder Does Not Exist. Create
IF Folder Name is not found in Column C, Move to different location
Mighty Excel Masters please help, maybe you can tweak the code i have? It worked to create all the folders but not sure how to tweak it.
IF Folder Exists. Do nothing
IF Folder Does Not Exist. Create
IF Folder Name is not found in Column C, Move to different location
Mighty Excel Masters please help, maybe you can tweak the code i have? It worked to create all the folders but not sure how to tweak it.
VBA Code:
Sub UpdateFolders_Click()
Dim Rng As Range
Dim maxRows, maxCols, r, c As Integer
Set Rng = Range("C1:C99")
maxRows = Rng.Rows.Count
maxCols = Rng.Columns.Count
For c = 1 To maxCols
r = 1
Do While r <= maxRows
If Len(Dir("C:\Location\Location\Location" & "\" & Rng(r, c), vbDirectory)) = 0 Then
MkDir ("C:\Location\Location\Location " & "\" & Rng(r, c))
On Error Resume Next
End If
r = r + 1
Loop
Next c
End Sub
Last edited by a moderator: