+ Reply to Thread
Results 1 to 6 of 6

How to fetch the file names

  1. #1
    Forum Contributor
    Join Date
    07-15-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    116

    How to fetch the file names

    Hi guys, here's my query

    A folder in win7 contain some files such as 0001.xlsx , 0002.xlsx & this list grows in ascending order everyday.
    Now i want the file name that has the 'highest no' to get displayed in my worksheet. For eg if i have files from 0001 to 0058
    then i want '0058' to be displayed in my main worksheet so that i don't have to open that folder again & again for reference.

    Secondly i would like to get the last/recent 5 file names that i have saved in a particular folder, irrespective of their values.
    For instance:

    file-a
    0001
    abc
    file-b
    address

    Kindly please give me some simplified formula. Thanks guys.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: How to fetch the file names

    Cannot be done with a formula. Requires VBA.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    07-15-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    116

    Re: How to fetch the file names

    Can someone please help with the code?

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: How to fetch the file names

    How much do you know about VBA code? This would require a bit of work, more than I am able to commit to on a free forum. I could provide some guidance as to the approach.

  5. #5
    Forum Contributor
    Join Date
    07-15-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    116

    Re: How to fetch the file names

    Does first query also requires much of work. i.e. 'fetching file name having the largest no' ?

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,879

    Re: How to fetch the file names

    As 6 as indicated this is a major undertaking. What I can offer you and nothing else in this area is a macro that will deliver the names of all files, the last modified date and its size for a particular directory that you name. Here is that code. You may wish to try and modify it to meet your needs or filter the results after running it for your particulars.

    Please Login or Register  to view this content.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ 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. How to fetch User DSN Names and show it as a Drop Down
    By Kandavalli.Kiran in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-03-2017, 08:34 AM
  2. want to fetch data from closed file *.csv
    By nileshsingara in forum Excel General
    Replies: 1
    Last Post: 03-18-2017, 08:09 AM
  3. Fetch File statistics including rowcount
    By Tarana1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-06-2017, 12:10 AM
  4. fetch size of file in excel
    By notbanme in forum Excel General
    Replies: 3
    Last Post: 09-26-2016, 07:43 AM
  5. How to fetch first few values or names from excel column
    By meetvivek72 in forum Excel General
    Replies: 5
    Last Post: 02-13-2014, 06:48 AM
  6. [SOLVED] Interesting, but how to fetch data from another Excel file?
    By BNCOXUK in forum Excel General
    Replies: 2
    Last Post: 11-29-2012, 05:51 AM
  7. [SOLVED] Fetch list of table names in access to a record set
    By Prashantha Weerakoon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-06-2005, 08:06 AM

Tags for this Thread

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