+ Reply to Thread
Results 1 to 17 of 17

Putting a list of filenames from a directory into an Excel range in Excel 2011 (Mac)

  1. #1
    Registered User
    Join Date
    09-23-2013
    Location
    Bruton, Somerset
    MS-Off Ver
    Office 2011 MAC
    Posts
    17

    Putting a list of filenames from a directory into an Excel range in Excel 2011 (Mac)

    I have a directory of some 200 filenames which I want to put into a range of cells. Is there a simple way to do this?
    I would appreciate an easy to follow set of instructions.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Putting a list of filenames from a directory into an Excel range in Excel 2011 (Mac)

    This is a macro that was given to me to do the same thing, perhaps you can get it working for you...
    Please Login or Register  to view this content.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    09-23-2013
    Location
    Bruton, Somerset
    MS-Off Ver
    Office 2011 MAC
    Posts
    17

    Re: Putting a list of filenames from a directory into an Excel range in Excel 2011 (Mac)

    I'm afraid I do not know how to use the code. Perhaps someone could fill in the blanks for me?
    The directory is a list of names in a folder "HorologicalBooks". I want to paste them into a new worksheet range "A1-A200".

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Putting a list of filenames from a directory into an Excel range in Excel 2011 (Mac)

    Are you OK with a formula solution (macro-enabled)?
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  5. #5
    Registered User
    Join Date
    09-23-2013
    Location
    Bruton, Somerset
    MS-Off Ver
    Office 2011 MAC
    Posts
    17

    Re: Putting a list of filenames from a directory into an Excel range in Excel 2011 (Mac)

    Perhaps my abilities are best summed up by the fact that I don't even understand the question! I use Excel every day to maintain accounts and catalogues but have never got involved with macros and such. I would like the simplest method of achieving what I want.
    Many thanks for your help and patience.

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Putting a list of filenames from a directory into an Excel range in Excel 2011 (Mac)

    Ha ha...

    try this and let me know if/when you get stuck!!

    Set up a named range called fl using this formula (CTRL F3)
    =FILES("your file path to the target folder, starting from C, goes here\*")&T(NOW())

    Save as macro-enabled file. Close & reopen. Then in A1,

    =IFERROR(LEFT(INDEX(fl,ROW()),LEN(INDEX(fl,ROW()))-5),"")

    drag down.
    Last edited by Glenn Kennedy; 08-09-2015 at 05:15 AM.

  7. #7
    Registered User
    Join Date
    09-23-2013
    Location
    Bruton, Somerset
    MS-Off Ver
    Office 2011 MAC
    Posts
    17

    Re: Putting a list of filenames from a directory into an Excel range in Excel 2011 (Mac)

    Where and how do I do this -

    "Set up a named range called fl using this formula (CTRL F3)
    =FILES("your file path to the target folder, starting from C, goes here\*")&T(NOW())"

    When I press CTRL F3 nothing happens! The above implies Windows, I am using a Mac. My file path is /Users/ronkirkpatrick/Desktop/HorologicalBooks/

    drag down?

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Putting a list of filenames from a directory into an Excel range in Excel 2011 (Mac)

    Mmm. this may cause problems all the way through. We'll see.

    fn+command+F3

    should get you there on a Mac.

  9. #9
    Registered User
    Join Date
    09-23-2013
    Location
    Bruton, Somerset
    MS-Off Ver
    Office 2011 MAC
    Posts
    17

    Re: Putting a list of filenames from a directory into an Excel range in Excel 2011 (Mac)

    CTRL F3 brings up the Dock, fn CMD F3 clears the screen! CMD F3 brings up Mission Control.

    What are we trying to do? Where are we trying to create a macro?

  10. #10
    Registered User
    Join Date
    09-23-2013
    Location
    Bruton, Somerset
    MS-Off Ver
    Office 2011 MAC
    Posts
    17

    Re: Putting a list of filenames from a directory into an Excel range in Excel 2011 (Mac)

    This is no doubt relevant -

    With Excel 2011, you can continue to use and maintain Excel 4.0 macros (XLM macros) that have not been upgraded to Visual Basic® for Applications (VBA). Although you cannot record new Excel 4.0 macros in Excel 2011, you can run and modify them.
    The Excel 4.0 Macro Reference provides information including syntax and examples for the macro functions. You can find more information about the Excel 4.0 Macro Reference on the Microsoft Web siteClick this link to open a browser window. (www.microsoft.com/downloads).

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Putting a list of filenames from a directory into an Excel range in Excel 2011 (Mac)

    Insert/Name/Define????

  12. #12
    Registered User
    Join Date
    09-23-2013
    Location
    Bruton, Somerset
    MS-Off Ver
    Office 2011 MAC
    Posts
    17

    Re: Putting a list of filenames from a directory into an Excel range in Excel 2011 (Mac)


  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Putting a list of filenames from a directory into an Excel range in Excel 2011 (Mac)

    OK. Put fl in the Names and the formula in the refers to bit.

    There's still hope!!

  14. #14
    Registered User
    Join Date
    09-23-2013
    Location
    Bruton, Somerset
    MS-Off Ver
    Office 2011 MAC
    Posts
    17

    Re: Putting a list of filenames from a directory into an Excel range in Excel 2011 (Mac)

    Putting fl in the Names doesn't work, it doesn't reference anything! It won't accept the path saying it is not a name.

  15. #15
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Putting a list of filenames from a directory into an Excel range in Excel 2011 (Mac)

    I know nothing about Macs (as you can tell!!) - but doesn't the drive have a name - like C, or similar?? Does the path really start with /Users??? Surely not...

  16. #16
    Registered User
    Join Date
    09-23-2013
    Location
    Bruton, Somerset
    MS-Off Ver
    Office 2011 MAC
    Posts
    17

    Re: Putting a list of filenames from a directory into an Excel range in Excel 2011 (Mac)

    On a Mac discs have names (you could name a disc C but not usual). As Users is on the System drive /Users is an appropriate path.
    I thought that as Excel needed to know where to find the list of names I would copy it, paste it into a cell in Excel and reference it. I didn't get any further than that because when I pasted the list (of 76 names) into C1 the names appeared in C1:C76 which is exactly what I have been trying to do!!
    Is there a secret function in Excel 2011?
    I wish to thank you very sincerely for your help and support, it is very much appreciated.
    Ron

  17. #17
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Putting a list of filenames from a directory into an Excel range in Excel 2011 (Mac)

    ha ha. If it had worked on a Mac... the approach I was advocating would have been dynamic - add more files, more names would have appearred automatically. However you're there.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel 2011. Is there a way to insert a comment for a range of cells?
    By so_fistica_ted in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 5
    Last Post: 07-02-2015, 02:03 PM
  2. Validation list from Mac Excel 2011 fails to function on Windows 7 Excel 2010
    By lhlevasseur in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 3
    Last Post: 12-17-2012, 07:08 PM
  3. List of macros (Excel 2011 for Mac) and- if it exists - their translation in french
    By PhilippeS in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 3
    Last Post: 10-17-2012, 05:57 AM
  4. Inserting picture filenames in an excel list
    By tryer in forum Excel General
    Replies: 0
    Last Post: 05-01-2007, 05:04 PM
  5. Replies: 11
    Last Post: 06-06-2006, 01:20 PM
  6. [SOLVED] list directory in EXCEL
    By Marina Limeira in forum Excel General
    Replies: 1
    Last Post: 01-17-2006, 12:20 PM
  7. Parse Directory Filenames
    By chrisjnorskov in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-22-2005, 07:56 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1