+ Reply to Thread
Results 1 to 8 of 8

Copying file names from a directory to Excel

  1. #1
    Registered User
    Join Date
    08-18-2011
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    60

    Copying file names from a directory to Excel

    I have over 100 report names in a directory that I want to copy to excel. The only way I have found to do this is to right click on the file, choose properties, in the General tab highlight and select the file name and copy and paste it into Excel. I would like to make this process go much faster and not be so tedious. Is there a way? TIA.
    Last edited by paperwings25; 09-17-2013 at 10:23 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Copying file names from a directory to Excel

    Please Login or Register  to view this content.
    you can use the DIR function. Change path and file search pattern to suit
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    08-18-2011
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    60

    Re: Copying file names from a directory to Excel

    I would like the macro to just go down the list in the directory and copy them all into excel. Is there a way to do that?

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Copying file names from a directory to Excel

    Do you mean the actual contents of those files?

    Currently that macro simply lists filenames on a worksheet from specificed folder with a file name search patter of *.xls*

  5. #5
    Registered User
    Join Date
    08-18-2011
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    60

    Re: Copying file names from a directory to Excel

    It worked! Thank you!

  6. #6
    Registered User
    Join Date
    08-18-2011
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    60

    Re: Copying file names from a directory to Excel

    If I want to copy some PDF names in, would I just change .xls to .pdf in the macro?

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Copying file names from a directory to Excel

    yes

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    08-18-2011
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    60

    Re: Copying file names from a directory to Excel

    Saved me hours. Thanks!

+ 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. Finding file names in a directory
    By wilro85 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-17-2008, 05:17 PM
  2. Get file names from a directory
    By paulmezick in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-22-2008, 11:44 AM
  3. Import file size and file names from a directory
    By zahid in forum Excel General
    Replies: 1
    Last Post: 02-07-2006, 09:35 AM
  4. [SOLVED] to convert all the file names in one directory to .xls?
    By S.G.Pillai in forum Excel General
    Replies: 2
    Last Post: 09-27-2005, 01:05 PM
  5. Getting file names in a directory
    By John in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-08-2005, 12:06 PM

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