+ Reply to Thread
Results 1 to 10 of 10

Save File by Cell Entry and keep macros

  1. #1
    Forum Contributor rkjudy's Avatar
    Join Date
    03-31-2009
    Location
    Longview, TX
    MS-Off Ver
    MS Office 2010
    Posts
    239

    Save File by Cell Entry and keep macros

    I am a novice to VB but would like to save a spreadsheet with the contents of a cell as the name. My problem is that I have several macros in the workbook and if I change the name of the file when I save, it won't run the macros when I reopen because the filename has changed. It presents me with an error saying it can't find the macro. Any suggestions anyone?
    Last edited by rkjudy; 04-06-2009 at 08:11 PM.

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983

    Re: Save File by Cell Entry and keep macros

    If the macro is saved with the workbook then you need to change your macro code so they do not need to to use the workbook name

    Instead of using
    Please Login or Register  to view this content.
    you could use
    Please Login or Register  to view this content.
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  3. #3
    Forum Contributor rkjudy's Avatar
    Join Date
    03-31-2009
    Location
    Longview, TX
    MS-Off Ver
    MS Office 2010
    Posts
    239

    Re: Save File by Cell Entry and keep macros

    Thanks for your help. It worked perfectly, but I have an additional problem along these same lines. I have some macros that call other macros to execute. The Application.Run statement in the running macro references the macro with the original file name. If I save the workbook with a new name, the macro bugs out because the macro with the original file name does not exist in the newly named workbook. Can you help?

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Save File by Cell Entry and keep macros

    Why are you using Application.Run?

    Post the code?
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Forum Contributor rkjudy's Avatar
    Join Date
    03-31-2009
    Location
    Longview, TX
    MS-Off Ver
    MS Office 2010
    Posts
    239

    Re: Save File by Cell Entry and keep macros

    Because I'm a novice, I use the 'Record Macro' most of the time to create my macros and that's the statement it used when I ran another macro while recording. Here are three lines of the macro including the Application.Run statement. Any alternatives?

    Please Login or Register  to view this content.
    Last edited by rkjudy; 04-03-2009 at 10:51 AM.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Save File by Cell Entry and keep macros

    Please read the forum rules about code tags, and then edit your post to add them.
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor rkjudy's Avatar
    Join Date
    03-31-2009
    Location
    Longview, TX
    MS-Off Ver
    MS Office 2010
    Posts
    239

    Re: Save File by Cell Entry and keep macros

    Because I'm a novice, I use the 'Record Macro' most of the time to create my macros and that's the statement it used when I ran another macro while recording. Here are three lines of the macro including the Application.Run statement. Any alternatives?


    Please Login or Register  to view this content.
    Sorry about the tag.

  8. #8
    Forum Contributor rkjudy's Avatar
    Join Date
    03-31-2009
    Location
    Longview, TX
    MS-Off Ver
    MS Office 2010
    Posts
    239

    Re: Save File by Cell Entry and keep macros

    Bump no response

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Save File by Cell Entry and keep macros

    Bump no response
    Hello? Post #6?

  10. #10
    Forum Contributor rkjudy's Avatar
    Join Date
    03-31-2009
    Location
    Longview, TX
    MS-Off Ver
    MS Office 2010
    Posts
    239

    Re: Save File by Cell Entry and keep macros

    Duh, thanks for your help.

+ 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