Creating a folder with excel
steen37
Posted messages
10
Status
Member
-
steen37 Posted messages 10 Status Member -
steen37 Posted messages 10 Status Member -
Hello,
Starting from an Excel file listing a single column of names, I would like to create a folder for each name where I will put photos, etc.
Thank you for your help.
Starting from an Excel file listing a single column of names, I would like to create a folder for each name where I will put photos, etc.
Thank you for your help.
5 answers
-
-
-
https://fr.wikipedia.org/wiki/Microsoft_Excel#Macros
and https://excel-malin.com/codes-sources-vba/creation-dossiers-et-sous-dossiers-en-vba/
otherwise maybe a kind soul here could help you do it if you share your file. -
-
-
-
-
-
So if a good soul can help Steen37 show him how to make this macro, thank you in advance.
-
Which version of Excel is it about? What level of update? On which version of Mac OS X?
--
Hello at your place!
Bernard -
You should currently be on version 14.7.6.
That said, to create folders on the desktop with the names contained in cells A1:A3, you can use the following macro:
Sub AutreTest()
Lines = 3 ' last line of the range to process
For i = 1 To Lines
FolderName = Worksheets("Sheet1").Range("A" & i).Value
MyScript = "tell application " & Chr(34) & "Finder" & Chr(34) & Chr(13) & _
"do shell script ""mkdir -p "" & quoted form of posix path of (" & _
Chr(34) & "/Users/YourShortName/Desktop/" & FolderName & Chr(34) & ")" & _
Chr(13) & "end tell"
On Error Resume Next
MacScript (MyScript)
On Error GoTo 0
Next i
End Sub
Of course, this needs to be adapted to your specific needs (if your range is A6:A42, you need to start reading at 6 and not at 1, and the value of the Lines variable should be 42 and not 3 - if you don't want to create the folders on the desktop, you need to adapt the path, etc.)
Hello at your place!
Bernard