+ Reply to Thread
Results 1 to 4 of 4

Macro that is unaffected by file name changes

  1. #1
    Registered User
    Join Date
    01-22-2015
    Location
    Germany
    MS-Off Ver
    2007
    Posts
    2

    Macro that is unaffected by file name changes

    Hi everyone!

    So I have this macro that changes a completely illegible date format to a normal (in my case German one).
    I am no good with VBA so I recorded it with the tool - and it works!
    It uses a different macro I recorded within the macro, as seen in this line:

    [...]
    Application.Run "EvaluationWorkingCopy!englischer_Monat_zu_Zahl"
    [...]

    But the file is going to be copied and renamed a lot of times. For now the document is called "EvaluationWorkingCopy".

    Now, my problem is this: If I rename the document, it can't run the big macro because the file name in the "englischer_Monat_zu_Zahl" macro didn't change. Is there a way to automatically change the name / store it in a variable that is getting called?

    Thanks in advance.
    Last edited by firala; 01-22-2015 at 10:40 AM.

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Macro that is unaffected by file name changes

    Try
    Please Login or Register  to view this content.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro that is unaffected by file name changes

    Does this help?

    https://support.office.com/en-nz/art...0-6e4c3f5ee566

  4. #4
    Registered User
    Join Date
    01-22-2015
    Location
    Germany
    MS-Off Ver
    2007
    Posts
    2

    Re: Macro that is unaffected by file name changes

    Wow, thanks for the quick answer!
    Arkadi, that worked wonders.
    John, sorry, but for some reason the work laptop won't let me access this.
    I'll mark this as solved, thanks again!

+ 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 macro that specifies file type, file location and takes file name from three cells
    By ExcelFailure in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-13-2013, 10:09 PM
  2. Replies: 8
    Last Post: 11-12-2012, 02:39 PM
  3. macro prompts immediately to open a file once the Excel file with the macro is opened
    By jhmayor03 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-03-2012, 10:00 AM
  4. [SOLVED] Tricky one ( variant type text to be unaffected by a minus)
    By James Cornthwaite in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-18-2006, 04:55 PM
  5. How do I secure borders, make them unaffected by copying or draggi
    By sebds70 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-21-2005, 09:06 AM

Tags for this Thread

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