+ Reply to Thread
Results 1 to 3 of 3

How to change macro to specific worksheet

  1. #1
    Registered User
    Join Date
    04-13-2011
    Location
    Glasgow
    MS-Off Ver
    Excel 2007
    Posts
    7

    Post How to change macro to specific worksheet

    Hello, I am currently writing a program to create a rota at my office. The rota is created on a master page and using a macro is transferred to a new worksheet, named after the rota date, containing 4 different templates, one for each floor. I also need to print out a daily register by going into these saved sheets and printing out a specific day onto another worksheet. My problem is that although the macros for each day are copied when i create a new rota, they take their references from the original sheet each time instead of the current one. Is there anyway to change the macro to use the current rota date when copying info over instead of the original. The original worksheet is called rota, but the new one is called 22 MAY, however the macro always say Sheet("ROTA").Select, instead of ("22 MAY") if you know what i mean. Hope someone can help me
    Thanks.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: How to change macro to specific worksheet

    Hi hezcal11 and welcome to the forum,

    All this is a matter of programming. You can change worksheets the macro is dealing with in code. There are a lot of ways to do this.

    Look at http://www.exceltip.com/excel_tips/E...rkbook/22.html for many tips on dealing with different workbooks and worksheets.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    04-13-2011
    Location
    Glasgow
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: How to change macro to specific worksheet

    Thanks will have a look.

+ 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