+ Reply to Thread
Results 1 to 4 of 4

function to return part of a string

  1. #1
    Registered User
    Join Date
    01-18-2007
    Posts
    16

    function to return part of a string

    I have a cell that returns the file name and I want to extract a piece of that for another cell.

    C:\Documents and Settings\My Documents\[Workbook.xls]Worksheet

    Is there a function that will return the part between the brackets (Workbook.xls)? I thought about using the MID function, but the file location changes and I can't always count on the workbook name being in the same starting position each time.

    I seem to recall Excel being able to search for a particular character - in this case the bracket [ - and returning anything after that, but I don't remember the function.

    Or better yet, is there a function that will give me JUST the workbook name without the full filepath?

    Any ideas?

    Thanks!

    -sara

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Does this link help

    http://www.cpearson.com/excel/excelF.htm#FileName

    Follow the below link for more top tips

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    01-18-2007
    Posts
    16
    Thanks. Worked perfectly!

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    No problem

    Glad it helped

    VBA Noob

+ 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