+ Reply to Thread
Results 1 to 4 of 4

Macro Use after File Name is Changed

  1. #1
    Registered User
    Join Date
    10-31-2009
    Location
    New Mexico
    MS-Off Ver
    Excel 2003
    Posts
    2

    Macro Use after File Name is Changed

    I use Excel 2003. I've written some macros for a workbook, BookA, that will be opened then saved, many times and with many other names. The problem is that the macros transfer data to and from another workbook, BookB. The name BookB will never be changed. Here's part of the code that's giving me problems:


    Please Login or Register  to view this content.
    How can I use the macro if I open BookA.xls then change the name to BookZ.xls for my data entries? At the same time BookZ is open, I may use another instance of BookA.xls and save that one as BookY.xls. What's the most feasible way to still use the macros that I've created in BookA? Can it even be done?

  2. #2
    Registered User
    Join Date
    10-31-2009
    Location
    New Mexico
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Macro Use after File Name is Changed

    So how 'bout this?

    What if, when I open BookA, I save it as BookZ where I enter all the data. Then, when the project is complete, I run a macro that changes the name back to BookA, runs the macro which transfers data to BookB, then changes the name back again to BookZ.

    If I do that, it seems the macros will all run as planned. Correct?

    I still need help with the code.

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

    Re: Macro Use after File Name is Changed

    Hard to guess; maybe like this:
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: Macro Use after File Name is Changed

    As Shg says, it is hard to guess but here's another try using Shg's approach...

    Please Login or Register  to view this content.
    hth
    Rob
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

+ 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