+ Reply to Thread
Results 1 to 7 of 7

Save a Workbook With A file path and name referenced cell

  1. #1
    Forum Contributor
    Join Date
    12-10-2008
    Location
    Hong Kong
    MS-Off Ver
    Office 365 PC Version
    Posts
    204

    Save a Workbook With A file path and name referenced cell

    Hi,

    Thanks for taking a look at my problem.

    I have a workbook which I want to save as and the name of the workbook is in a cell with a name reference (i.e. My_File_Name_And_Path)

    First I tried the following which works just fine:

    Please Login or Register  to view this content.
    In My_File_Name_And_Path I have entetred:

    C:\Pinnacle-CG\Clients 7-2009\Tugu Mandiri\Model\FPOF\Book2.xlsm

    I next tried the following which does not work:

    Please Login or Register  to view this content.
    Is it possible to make this work?

    Thanks and regards JV

  2. #2
    Forum Contributor
    Join Date
    12-10-2008
    Location
    Hong Kong
    MS-Off Ver
    Office 365 PC Version
    Posts
    204

    Re: Save a Workbook With A file path and name referenced cell

    I also tried the following which worked. The cell G13 is name My_File_And_Path_Name.

    Please Login or Register  to view this content.
    Want I want is to use the cell name so that if I insert columns or rows the reference will allways be the cell My_File_And_Path_Name

    Thanks for any help JV

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,669

    Re: Save a Workbook With A file path and name referenced cell

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Contributor
    Join Date
    12-10-2008
    Location
    Hong Kong
    MS-Off Ver
    Office 365 PC Version
    Posts
    204

    Re: Save a Workbook With A file path and name referenced cell

    Hi,

    I tried this before and it gives me an error message "method range of object global failed"

    Any other suggestions?

    Thanks JV

  5. #5
    Forum Contributor
    Join Date
    12-10-2008
    Location
    Hong Kong
    MS-Off Ver
    Office 365 PC Version
    Posts
    204

    Re: Save a Workbook With A file path and name referenced cell

    Ok I got that to work made a typo, thanks.

    What is the difference between range("My_File_Path_And_Name") and range([My_File_Path_And_Name])?

    Thanks JV

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,669

    Re: Save a Workbook With A file path and name referenced cell

    Some options:

    Please Login or Register  to view this content.

    The first is a basic range statement. The second is a short cut evaluation ... I rarely use this. The third is a reference to a named range. And the last refers to a variable containing a cell address string.

    Not sure where you got your range([...]) from although you do see stuff like that in relation to Tables. For example:

    Please Login or Register  to view this content.

    ... will loop through every cell in the Status column in the tabSummary Table.


    Regards, TMS

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,669

    Re: Save a Workbook With A file path and name referenced cell

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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. save as to file path using cell name
    By WillieW in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-08-2013, 01:53 AM
  2. Replies: 5
    Last Post: 03-21-2013, 07:34 AM
  3. Macro button to separate workbook as a file name referenced from cell.
    By Moonpie in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-09-2012, 12:19 PM
  4. Rename and save file to path based on cell info
    By cabinetguy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-07-2010, 12:38 PM
  5. Save Workbook using name and path in a cell
    By adinic in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-11-2007, 01:27 PM

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