+ Reply to Thread
Results 1 to 4 of 4

How to Extract the File Name from Its Full Path?

  1. #1
    Registered User
    Join Date
    06-17-2022
    Location
    Aleppo, Syria
    MS-Off Ver
    2007
    Posts
    10

    How to Extract the File Name from Its Full Path?

    Hello,
    I presented on the attached file ‘ExtractFileNameFromFullPath.xlsx’ the way I use extracting the file name from its full path.
    I wonder if there is a better way to do it.
    Thank you.
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,387

    Re: How to Extract the File Name from Its Full Path?

    Administrative Note:

    Members will tailor the solutions they offer to the version (NOT release number) of Office (Excel, NOT Windows) that you have. Please check that your forum profile is up-to-date in this respect. If you aren't sure, in Excel go to File | Account and report what it says below the MS logo at the top of that page. If your version is for Mac, please also state this. Thanks.

    Try this:

    =TRIM(RIGHT(SUBSTITUTE(D5,"\",REPT(" ",99)),98))
    Attached Files Attached Files
    Last edited by AliGW; 07-22-2022 at 01:56 AM. Reason: Added example workbook.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    06-17-2022
    Location
    Aleppo, Syria
    MS-Off Ver
    2007
    Posts
    10

    Re: How to Extract the File Name from Its Full Path?

    Thank you for the formula.

    For instance, I use Excel 2007 on Windows 7.
    Last edited by AliGW; 07-22-2022 at 05:57 AM. Reason: Please DON'T quote unnecessarily!

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,387

    Re: How to Extract the File Name from Its Full Path?

    That's fine - I was just checking that 2007 was correct in your profile.

+ 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. Extract path names from list of full pathnames
    By Szyfrow in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-07-2022, 05:00 PM
  2. Extract external workbook full path from formula
    By dluhut in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-29-2019, 02:50 PM
  3. [SOLVED] Power Query - Extract FileName for Full Path in Cell
    By jgarza0422 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-11-2019, 10:20 AM
  4. Replies: 1
    Last Post: 11-18-2016, 03:33 PM
  5. Extract full name from path and open it (or not)
    By Remphan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-27-2016, 03:36 AM
  6. Replies: 7
    Last Post: 10-09-2009, 10:10 AM
  7. [SOLVED] extract filename from full path
    By Leung in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-03-2005, 06:05 PM

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