Creating a folder with excel

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 answers

  • Votes
  • Date
  • Descending date
  1. Contributor
    Hello,

    You need to create a macro, see example: https://www.youtube.com/watch?v=WGk0Q_G_Z08
    1. Thank you for this quick response, the problem is that I don’t even know what a macro is!
    2. @regcalI need a complete example from A to Z and I should be able to do it, right?
      Where should I send a test file?
    3. Contributor
      Put your example on the cijoint site and put the link here and wait for someone to come by to help you.
    4. @regcalJe 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.
  2. Contributor
    So if a good soul can help Steen37 show him how to make this macro, thank you in advance.
    1. thank you
  3. Contributor
    Which version of Excel is it about? What level of update? On which version of Mac OS X?

    --
    Hello at your place!
    Bernard
    1. VERSION 14.7.2 for Excel
      MacOS Sierra 10.12.6
  4. Contributor
    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
    1. Thank you, I will try to get my bearings.