Hello folks:
I created a script to create a folder based on a cell value. However, I actually needed to create folders based on the values of column F. How do I create a loop to do that?
Any help will be appreciated.
I created a script to create a folder based on a cell value. However, I actually needed to create folders based on the values of column F. How do I create a loop to do that?
Any help will be appreciated.
VBA Code:
Sub CreateFolder()
Dim NewFolder As String
NewFolder = "C:\2022 STI Folder\PDF\" & Range("F2")
If Len(Dir(NewFolder, vbDirectory)) = 0 Then
MkDir NewFolder
Else
MsgBox "Folder already exists"
End If
End Sub