5 réponses
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:
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
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
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.
Where should I send a test file?