+ Reply to Thread
Results 1 to 2 of 2

Reuse Macro on Several sheets with Different Sheet names

  1. #1
    Registered User
    Join Date
    05-13-2014
    MS-Off Ver
    Excel 2003
    Posts
    1

    Question Reuse Macro on Several sheets with Different Sheet names

    I am hoping someone can help. This is probably basic but I am stuck and cannot seem to get it right.
    I have a macro that creates a copy of template worksheet. The purpose of this is so that I can remove the linked formulas so that the created worksheet remains fixed.

    This process is repeated over and over again to capture singular events through time. The Names of these created worksheets are set by the user (but for the sake of this tread I am calling them Project 1, Project 2, etc.)

    At a point in the future I want to go into these fixed sheets and copy and paste portions of them back to another template that I use as an ouput document (within the same workbook). So I need a macro that I can reuse that essentially does the same process, but whos active sheet name is variable.

    So for example; the worksheet Project 1 is one of the sheets I want to execute the macro from. I do not want the macro to execute from all of them just the active one. The macro will always refer back to the template worksheet TeamMemberMaster.

    Here is sample of the code

    Please Login or Register  to view this content.
    What I need is to make the macro work from ANY of the Project sheets (not just Project 1). Any help is appreciated.
    Last edited by JBeaucaire; 05-13-2014 at 09:20 PM. Reason: Added missing CODE tags. Please read and follow the Forum Rules, link above in the menu bar. Thanks.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Reuse Macro on Several sheets with Different Sheet names

    One way, this will copy FROM the currently activesheet to the template:

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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. [SOLVED] controlling sheet names when adding sheets to a workbook in a macro
    By jmac1947 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-08-2014, 03:30 AM
  2. Hyperlink Macro that converts a list of sheet names to hyperlinks to the sheets
    By holt3130 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-24-2013, 08:49 AM
  3. Replies: 17
    Last Post: 02-01-2013, 12:20 PM
  4. [SOLVED] Macro copying values and sheet names of all activated sheets
    By Rosixks in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-07-2011, 06:16 PM
  5. Replies: 5
    Last Post: 11-26-2006, 09:37 PM

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