Open a excel workbook always on the same sheet

N

Nikhil

I want to have a excel workbook open up everytime on a particular sheet. This
is irrespective of which sheet i had last accessed and saved the file.
However, when i reopen the file anytime, it must open up on sheet 1 (for e.g.)

Can anyone help plz

regards

Nikhil
 
J

JLatham

Use the Workbook_Open() event to deal with this. You can use a command like
Worksheets(1).Activate
or
Worksheets("name on sheet tab").Activate

The code has to go into the 'ThisWorkbook' object's code module. Open the
workbook and press [Alt]+[F11] to open the VB Editor. Press [Ctrl]+[R] to
make sure the "Project - VBAProject" pane is visible and right-click on the
'ThisWorkbook' object in the list (it will be at the bottom of the list of
worksheets in the book) and choose [View Code]. Copy and paste this code
into the module (change the (1) to use the worksheet name if you prefer) and
save the workbook.

Private Sub Workbook_Open()
Worksheets(1).Activate
End Sub

Testing it is easy enough, choose another sheet and save & close the
workbook and then reopen it. The sheet you identified should be presented to
you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top