Change Cells into Folders

K

keelsail

I have a large list in an Excel spreadsheet. I would like to create a folder
for each item in the list. Is this possible.
 
R

Ron de Bruin

Look in the VBA help for MKDIR
Loop through the list and create the folders with mkdir

If you need more help post back
 
K

keelsail

This may be a little advanced for me. I have never used VB. Is it possible
that you could provide basic instructions on how to do this in relation to my
spreadsheet list.

Regards

Keelsail
 
R

Ron de Bruin

Hi keelsail

Try this with the names in column A
It will create the folders in C:\

Or do you have the full path in the cells like C:\yourfoldername ?


Alt -F11
Insert>Module from the menu bar
paste the sub in there
Alt-Q to go back to Excel
Alt-F8
Select the sub and press Run

Sub test()
Dim rootfolder As String
Dim cell As Range

rootfolder = "C:\"

For Each cell In Columns("A").SpecialCells(xlCellTypeConstants)
On Error Resume Next
MkDir rootfolder & cell.Value
On Error GoTo 0
Next cell
End Sub
 
Top