+ Reply to Thread
Results 1 to 8 of 8

Find Details of Files in Folder

  1. #1
    Forum Contributor
    Join Date
    11-02-2007
    Location
    Leeds, England
    MS-Off Ver
    MS Office 2007
    Posts
    134

    Find Details of Files in Folder

    Hi,

    I tried to write a macro that will allow a user to select a folder, then extract how many rows are in each file in that folder, and show them in the workbook.

    I.e.

    Select Folder
    Open File 1
    Find last row
    Put this in Workbook Cell A1
    Open File 2
    Find last row
    Put this in Workbook Cell A2
    etc.

    The macro I made is here:

    Please Login or Register  to view this content.
    However, it does not work.

    If anyone has a better method, or can amend mine it'd be much appreciated.

    Thanks!
    dvent

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Dvent,

    Don't you need the tally of ALL the sheets' rows in the workbook, or is there only one sheet?

    Sincerely,
    Leith Ross

  3. #3
    Forum Contributor
    Join Date
    11-02-2007
    Location
    Leeds, England
    MS-Off Ver
    MS Office 2007
    Posts
    134
    Quote Originally Posted by Leith Ross
    Hello Dvent,

    Don't you need the tally of ALL the sheets' rows in the workbook, or is there only one sheet?

    Sincerely,
    Leith Ross
    There's only 1 sheet in each workbook in the folder, but there's multiple files.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Which version of Excel are you using? Filesearch is not available in Excel 2007.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Forum Contributor
    Join Date
    08-10-2006
    Posts
    723
    hi Dvent

    try this

    this assumes all your workbooks are in one folder except for the workbook you are trandferring the data into
    put your file path in
    this looks in column a for the last row with data in it

    Please Login or Register  to view this content.
    steve

  6. #6
    Forum Contributor
    Join Date
    11-02-2007
    Location
    Leeds, England
    MS-Off Ver
    MS Office 2007
    Posts
    134
    Quote Originally Posted by stevekirk
    hi Dvent

    try this

    this assumes all your workbooks are in one folder except for the workbook you are trandferring the data into
    put your file path in
    this looks in column a for the last row with data in it

    Please Login or Register  to view this content.
    steve
    hi steve, this doesn't seem to work. could you save this macro in a workbook and attach it for me to look at?

  7. #7
    Forum Contributor
    Join Date
    08-10-2006
    Posts
    723
    hi dvent

    2 things

    you are correct it would not work
    a1 and a2 has to have some data in them
    did you change the directory just change this one and run macro


    file attached

    steve
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,465
    Quote Originally Posted by dvent
    Hi,
    Select Folder
    Open File 1
    Find last row
    Put this in Workbook Cell A1
    Open File 2
    Find last row
    Put this in Workbook Cell A2
    etc.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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