+ Reply to Thread
Results 1 to 5 of 5

Eliminating filename from path in formula

  1. #1
    Registered User
    Join Date
    06-08-2009
    Location
    Annapolis, Maryland
    MS-Off Ver
    Excel 2007
    Posts
    85

    Eliminating filename from path in formula

    Hello again.

    I found a way to save a workbook2 to the same directory and folder of the workbook1 that called upon it. But to make that happen, I type the path into the cell tied to the macro (cell B90).
    I'm using the following formula to auto-copy the path of workbook1 to a cell in workbook2 --

    =LEFT(CELL("filename"),FIND("]",CELL("filename"),1))

    The way it copies into workbook 2 is --

    G:\Tidewater Sales\River Road\97844 Sign Repair\Estimating\[97844 Sign Repair Estimate 2.xls]

    I believe the brackets in the filename are what's giving me a 404 error. Can't seem to alter the formula with my limited knowledge.

    Any ideas? I just want the directory and folder names to appear in the path. Thanks!
    Last edited by debbiesh; 03-07-2012 at 11:41 AM. Reason: Put bracket in wrong location

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Eliminating filename from path in formula

    If you're using VBA just use:

    Please Login or Register  to view this content.
    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    06-08-2009
    Location
    Annapolis, Maryland
    MS-Off Ver
    Excel 2007
    Posts
    85

    Re: Eliminating filename from path in formula

    Thanks for replying, Dom. I'm probably making it too complicated. I want the path of the first workbook to appear in a cell within its sheet1. I have a macro that will copy that cell contents into sheet1 of the new workbook2. But I don't want the file name to appear.

    How can I use your code in workbook1 to make the path appear in a cell? Like I said, limited knowledge. lol

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Eliminating filename from path in formula

    Just like this:

    Please Login or Register  to view this content.
    Dom

  5. #5
    Registered User
    Join Date
    06-08-2009
    Location
    Annapolis, Maryland
    MS-Off Ver
    Excel 2007
    Posts
    85

    Re: Eliminating filename from path in formula

    K, thanks for your help. I'll work on it.

+ 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