+ Reply to Thread
Results 1 to 5 of 5

Macro to run on all sheets except Activesheet

  1. #1
    Registered User
    Join Date
    03-23-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    15

    Macro to run on all sheets except Activesheet

    Hi,

    I want a macro that will go one by one to each sheet in workbook, and on that worksheet it will run another macro, without running it on activesheet. Like if I have 5 sheets and the fifth sheet is the active sheet, then on running the macro (when on fifth sheet), it should go to first sheet run Macro-ABC, then go to next sheet, run Macro-ABC, and so on till the last sheet excluding the sheet where the Macro was initialized, i.e leaving the original active sheet (the fifth sheet).

    Thanks
    Last edited by swagatam2014; 06-20-2013 at 05:33 AM.

  2. #2
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Macro to run on all sheets except Activesheet

    Consider:

    Please Login or Register  to view this content.
    Gary's Student

  3. #3
    Registered User
    Join Date
    03-23-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Macro to run on all sheets except Activesheet

    Appreciate your quick response. Your code does the trick. Thanks a ton!!!

    Also if you could help, what do I do if I want to exclude another sheet (April) from running macro in it

    I tried

    If Not s.Name = n, April

    But it doesn't work.

    Quote Originally Posted by Jakobshavn View Post
    Consider:

    Please Login or Register  to view this content.

  4. #4
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Macro to run on all sheets except Activesheet

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-23-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Macro to run on all sheets except Activesheet

    Thanks for your quick response !!!

    Quote Originally Posted by Jakobshavn View Post
    Please Login or Register  to view this content.

+ 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