Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2004
    Posts
    34

    Unanswered: Make sheet active when workbook opens

    I need to make sure that everytime the workbook opens it opens to sheet1

    The Activate Method code doesn't seem to be working I keep getting an error

    ThisWorkbook.Worksheet("Sheet1").Activate

    How do I take care of this?

  2. #2
    Join Date
    Oct 2003
    Posts
    1,091
    Try this:

    ThisWorkbook.Worksheets("Sheet1").Activate
    old, slow, and confused
    but at least I'm inconsistent!

    Rich
    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

  3. #3
    Join Date
    Jul 2004
    Posts
    34

    No go

    That was a no go it still isnt working. The caption of the work book is open ECN's. Sheet one's tabe is "open ECN log" but in the VBA tree they are still Thisworkbook and sheet1. have any more advice?

  4. #4
    Join Date
    Oct 2003
    Posts
    1,091
    This is the code that should work. I used "mySheet" as the worksheet name for the test. Put in the actual name of your worksheet.

    Code:
    Private Sub Workbook_Open()
        Worksheets("mySheet").Activate
    End Sub
    Where are you putting this code? It should not go in a general module. If you are in Excel, go to icon to left of File, right click and select "View Code". Then in VBE, in upper left dropdown, select Workbook. Then put this code.
    old, slow, and confused
    but at least I'm inconsistent!

    Rich
    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

  5. #5
    Join Date
    Jul 2004
    Posts
    34

    peachy keen

    thanks that worked!!!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •