+ Reply to Thread
Results 1 to 2 of 2

Sheet Name Change - Macro Doesn't Work

  1. #1
    Registered User
    Join Date
    08-16-2016
    Location
    Illinois, USA
    MS-Off Ver
    Office 365
    Posts
    49

    Sheet Name Change - Macro Doesn't Work

    I'm running into an error with a macro that is used to create a pivot table for some work reports. The problem I'm running into is when the report is exported, the sheet has a slightly varied name depending on which department it is for. I found a simple workaround by editing the sheet name to a short acronym before running the macro, and it works great. However, I would like to completely automate the process if possible. I know that you can use the sheet code name in instances like this, but no matter how I apply it to the code I receive the same error - Run-time error 5: Invalid procedure call or argument. Here is the code that shows in the debug:

    Please Login or Register  to view this content.
    Where NR = the sheet name I'm referring to for the pivot table. Any and all help is appreciated. Thank you in advance.
    Last edited by JBeaucaire; 02-11-2017 at 12:15 AM. Reason: Added missing CODE tags. Please read and follow the Forum Rules, link above in the menu bar. Thanks.

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Sheet Name Change - Macro Doesn't Work

    Is the NR sheet active when this runs? If so, then maybe:
    Please Login or Register  to view this content.
    David
    (*) Reputation points appreciated.

+ 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. code doesn't work when i change.
    By superchew in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-14-2015, 03:11 PM
  2. [SOLVED] Change macro to work on a different sheet
    By x65140 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-22-2014, 07:23 AM
  3. [SOLVED] Macro to change font doesn't work
    By graiggoriz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-26-2014, 02:39 PM
  4. [SOLVED] Macro Doesn't Work Through Button, Does Work Through Developer ->Macros Option
    By freybe06 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-27-2013, 11:55 AM
  5. Macro doesn't work after protecting sheet !
    By icalderhead in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-19-2013, 02:30 PM
  6. Macro doesn't work on UserInterfaceOnly-protected sheet
    By Kasama in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-08-2006, 05:25 AM
  7. Macro doesn't work if on wrong active sheet
    By shternm in forum Excel General
    Replies: 1
    Last Post: 02-02-2005, 09:05 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