0

I wrote the script below. I want to rewrite so if the folder exists, then ignore and move the next row.

Sorry, I can't get it to work.

Option Explicit

Sub Create_Folder()
    Dim sh As Worksheet
    Set sh = ThisWorkbook.Worksheets("STI Estimate (Lane)")
    Dim sub_folder_path As String
    
    Dim i As Integer
    
    For i = 4 To sh.Range("F" & Application.Rows.Count).End(xlUp).Row
        sub_folder_path = sh.Range("BF2").Value & Application.PathSeparator & sh.Range("F" & i).Value
        
        MkDir (sub_folder_path)
    Next i
End Sub
GSerg
  • 76,472
  • 17
  • 159
  • 346
Jose M.
  • 2,242
  • 8
  • 44
  • 66

0 Answers0