VBA Create Folders from Excel Cells

Babayaga3001 Posted messages 13 Status Membre -  
pilas31 Posted messages 1878 Status Contributeur -
Hello,

I feel really silly asking this question, but I've been scouring the websites and I can't figure it out...

I have a list of cells with different names and I want to save a folder named after each cell (from A1 to A33), on the sheet "Feuil1". The folder where I want to save these subfolders is named "C:\Users\Marine\Dropbox".

Could you please tell me the steps I need to follow?

Thanks a million!

Marine

7 réponses

pilas31 Posted messages 1878 Status Contributeur 648
 
Hello,

Here is a macro that should work:
Sub Create_Folders()
Dim line As Integer
ChDir "C:\Users\Marine\Dropbox"
For line = 1 To 33
MkDir Sheets("Sheet1").Cells(line, 1).Value
Next line
End Sub


Best regards,
0