Please, need help.
I need to insert into this loop a function to move any folders in the location that the name is not found in the range C1:C99
Been trying to figure this out and I'm Stuck.
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
I need to insert into this loop a function to move any folders in the location that the name is not found in the range C1:C99
Been trying to figure this out and I'm Stuck.
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