+ Reply to Thread
Results 1 to 6 of 6

How do I execute a macro upon changing to a specific sheet?

  1. #1
    Forum Contributor rkjudy's Avatar
    Join Date
    03-31-2009
    Location
    Longview, TX
    MS-Off Ver
    MS Office 2010
    Posts
    239

    How do I execute a macro upon changing to a specific sheet?

    I have a large workbook and I would like Excel to run a particular macro every time I go to a particular sheet. Does anyone know how? Thanks in advance.

  2. #2
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: How do I execute a macro upon changing to a specific sheet?

    Use this :
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor rkjudy's Avatar
    Join Date
    03-31-2009
    Location
    Longview, TX
    MS-Off Ver
    MS Office 2010
    Posts
    239

    Re: How do I execute a macro upon changing to a specific sheet?

    I did this. It doesn't work. Is there something wrong?

    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: How do I execute a macro upon changing to a specific sheet?

    Quote Originally Posted by rkjudy View Post
    I did this. It doesn't work. Is there something wrong?

    Please Login or Register  to view this content.
    Remove brackets. It will be
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor rkjudy's Avatar
    Join Date
    03-31-2009
    Location
    Longview, TX
    MS-Off Ver
    MS Office 2010
    Posts
    239

    Re: How do I execute a macro upon changing to a specific sheet?

    Still no luck. I put this code in the named sheet found in the 'Microsoft Excel Objects' folder on the VBA screen. Is this the right place to put the code? Sorry, I'm learning. Thanks again.

  6. #6
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: How do I execute a macro upon changing to a specific sheet?

    Quote Originally Posted by rkjudy View Post
    Still no luck. I put this code in the named sheet found in the 'Microsoft Excel Objects' folder on the VBA screen. Is this the right place to put the code? Sorry, I'm learning. Thanks again.
    No. Place that code on ThisWorkbook. Press Alt+F11, then you will see ThisWorkbook at the left panel. Double click on ThisWorkbook and place the code.

+ 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. Execute a macro in a closed workbook, or open and execute without the user noticing
    By cearaujo123 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-09-2015, 06:44 PM
  2. [SOLVED] Macro will not execute when called in a different sheet.
    By cudh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-05-2014, 09:46 AM
  3. How to execute a macro across a specific number of columns
    By lukasdylan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-06-2012, 03:42 PM
  4. [SOLVED] When sheet is activated, execute macro in other sheet and return to sheet
    By timtim89 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-16-2012, 10:50 AM
  5. Command line for open excel, insert a sheet, execute a macro, save file exit?
    By uschxc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-26-2012, 12:28 PM
  6. Automatically execute macro on separate sheet
    By johnrlalor in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-08-2010, 09:17 AM
  7. Protected Sheet Allows Macro to Execute
    By theSizz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-27-2010, 02:17 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