Activate specific sheet when workbook is opened

  • I have edited a workbook that originally had just an excel game on it.
    I created a new sheet tab on the same workbook and labeled it Sheet1 and that leaves the excel game on Sheet 2 or 3.
    My problem is that every time I open my workbook, it automatically goes to the the sheet with the game on it.
    I tried to force a code but it didn't work. This is the code I used...


    Code
    Private Sub Workbook_Open()
        Sheets("Welcome Color Laser Team!").Select
    End Sub


    I just started studying macros and VBA. So I have no idea what I am doing.
    I need help.

  • Re: Activate specific sheet when workbook is opened


    ReDvaNiLLa,


    Per the Forum Rules, VBA code must be wrapped in code tags, which you omitted. I've added the tags for you this time only.
    Please be sure to use them in future posts.


    How to use code tags


    Opening tag: [noparse]

    Code
    [/noparse]
    Closing tag: [noparse]

    [/noparse]


    See the tag link in my signature for more information on using tags.


    I would use:

    Code
    Private Sub Workbook_Open()
        Application.Goto Reference:=Sheet1.Range("A1"), Scroll:=True
    End Sub


    Where "Sheet1" is the sheet code name

  • Re: How to set the sheet as default?


    Thank you everyone.


    I have used PCI's code and it worked well. Good Job PCI!


    I will try the other codes.


    Thank you very much you guys.

  • Re: Activate specific sheet when workbook is opened


    Just a word of warning. While the code PCI gave will certainly do the job, if the sheet name is ever changed the code will fail.
    For this reason, I recommend using sheet code names because the VBA code is not affected by these potential changes.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!