Option Explicit
Sub MakeFolders()
Dim xdir As String 'give the directory a variable (xdir) and DIM it as String
Dim fso As Object 'DIM fso as a variable representing the FileSystemObject
Dim destfol As String 'DIM destfol (destination folder) as String
Dim lstrow As Variant 'DIM lstrow (last row) as Variant. Not certain how many rows will have data in Col A
'The total number will vary from time to time
Dim i As Long 'DIM the integer "i" as Long to accommodate an large number
Set fso = CreateObject("Scripting.FileSystemObject") 'FileSystemObject allows creation of folders.
destfol = Range("C4").Value 'destFol is the path entered in cell C4
lstrow = ActiveSheet.Cells(ActiveSheet.Rows.Count, "A").End(xlUp).Row 'Finds last used row in Col A
Application.ScreenUpdating = False 'Turn off ScreenUpdating. Makes things run faster.
For i = 2 To lstrow '<-- reads list beginning from A2
'Range("C4").Value tells Excel what the path is .. Range("A" & i).Value tells Excel to use the folder name
'from each cell in Col A with a name
xdir = Range("C4").Value & Range("A" & i).Value
If Not fso.FolderExists(xdir) Then 'If the folder doesn't already exist then
fso.CreateFolder (xdir) 'Using the FileSystemObject, create the folder named in xdir
End If
Next 'Began at row 2, now go to row 3 and repeat / row 4 and repeat, etc. until end of list Col A
Application.ScreenUpdating = True 'Turn ScreenUpdating back on to show all the changes created
MsgBox i - 2 & " folders created in Directory : C:\Users\My\Desktop\Test\" 'Display MsgBox showing how many
'folder were created and in what Folder they were created.
End Sub