Creating a folder with excel

steen37 Posted messages 10 Status Membre -  
steen37 Posted messages 10 Status Membre -
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.

5 réponses

regcal Posted messages 13011 Registration date   Status Contributeur Last intervention   4 658
 
Hello,

You need to create a macro, see example: https://www.youtube.com/watch?v=WGk0Q_G_Z08
0
steen37 Posted messages 10 Status Membre
 
Thank you for this quick response, the problem is that I don’t even know what a macro is!
0
regcal Posted messages 13011 Registration date   Status Contributeur Last intervention   4 658
 
0
steen37 Posted messages 10 Status Membre > regcal Posted messages 13011 Registration date   Status Contributeur Last intervention  
 
I need a complete example from A to Z and I should be able to do it, right?
Where should I send a test file?
0
regcal Posted messages 13011 Registration date   Status Contributeur Last intervention   4 658
 
Put your example on the cijoint site and put the link here and wait for someone to come by to help you.
0
steen37 Posted messages 10 Status Membre > regcal Posted messages 13011 Registration date   Status Contributeur Last intervention  
 
Je suis désolé, mais je ne peux pas ouvrir ou traiter des fichiers. Vous pouvez copier le texte que vous souhaitez traduire ici et je vous aiderai avec la traduction.
0
steen37 Posted messages 10 Status Membre
 
0
regcal Posted messages 13011 Registration date   Status Contributeur Last intervention   4 658
 
Yes, you also need to specify what exactly you want to do so that someone can show you how to do it.
0
steen37 Posted messages 10 Status Membre
 
I just want to create empty folders using the name of each line. One folder per name.
0
regcal Posted messages 13011 Registration date   Status Contributeur Last intervention   4 658
 
So if a good soul can help Steen37 show him how to make this macro, thank you in advance.
0
steen37 Posted messages 10 Status Membre
 
thank you
0
Aliboron Martin Posted messages 3657 Registration date   Status Contributeur Last intervention   989
 
Which version of Excel is it about? What level of update? On which version of Mac OS X?

--
Hello at your place!
Bernard
0
steen37 Posted messages 10 Status Membre
 
VERSION 14.7.2 for Excel
MacOS Sierra 10.12.6
0
Aliboron Martin Posted messages 3657 Registration date   Status Contributeur Last intervention   989
 
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
0
steen37 Posted messages 10 Status Membre
 
Thank you, I will try to get my bearings.
0