VBA: How To Activate a Sheet

August 14th, 2004 | Categories: VBA | Tags:

If you are dealing with code that refers to Activesheet many times, but you aren’t sure how to make the sheet you would like active, here’s how.

Before your code that refers to the active sheet, you must activate the sheet you would like manipulated. Here are two ways:

By program name:

sheet3.activate

By tab name:

sheets("mytabname").activate

Get LIVE Help
Custom Excel solutions & live Excel help!
► Go to www.ExcelAutomationHelp.com
► Email Now@ExcelAutomationHelp.com
  1. naveen
    July 20th, 2009 at 09:38
    Reply | Quote | #1

    thanks bro…………..

    i am looking for this actually

  2. vijay
    November 18th, 2009 at 10:20
    Reply | Quote | #2

    Thanks a lot, exactually what i want. :)
    cool, good job, keep up the good heart and work.

  3. cesar
    January 3rd, 2010 at 02:38
    Reply | Quote | #3

    Hi. I’m sorry about my English. I need to ask you something. What if I want to activate a sheet when I click on an specific option button and another sheet when I click on another option button? Help me please! Those option buttons are on a userform.

    • parameshwar
      December 4th, 2012 at 07:17
      Reply | Quote | #4

      if sheets(“”).optionbutton1.value = true then
      sheets(“sheet_12″).activate
      else
      sheets(“sheet_13″).activate
      end sub