+ Reply to Thread
Results 1 to 3 of 3

Need to change the macro to make it run only for the second sheet of the excel

  1. #1
    Registered User
    Join Date
    08-19-2009
    Location
    united states
    MS-Off Ver
    Excel 2003
    Posts
    56

    Need to change the macro to make it run only for the second sheet of the excel

    I have the following macro which works for the sheet that is open. I need to run this macro for the second sheet in my file when I click a button in first sheet..I have the button created but I am not able to run this from my first sheet.....can you please see this and tell me how to change it

    Please Login or Register  to view this content.
    Last edited by nynamyna; 03-10-2011 at 11:23 AM.

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Change in macro

    After a quick peek at your code it looks like it is referencing the ActiveSheet for your processes. This may or may not be what you want to have happen as this is why it is only working on whichever sheet you have activated. A way around this, even though it is not the best, would be to put this code in the button that you have created:
    Please Login or Register  to view this content.
    Where 2 is the worksheet number that you want your macro applied to. There might be other quirks that come up but it should be ok. You could also set a loop to do every worksheet but i dont think that is what you wanted to do.

  3. #3
    Registered User
    Join Date
    08-19-2009
    Location
    united states
    MS-Off Ver
    Excel 2003
    Posts
    56

    Re: Need to change the macro to make it run only for the second sheet of the excel

    This works perfectly...
    thank you very much

+ 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