Worksheet order

  • Thread starter Thread starter Stuart Johnson
  • Start date Start date
S

Stuart Johnson

I have searched through old messages but can't find the answer to
this.

I have an Excel file with a number of worksheets. How do I make it
default to open showing Worksheet 1 as the active sheet, instead of
Worksheet 4? In other words the left-hand one, not one further to the
right.
 
Stuart

Saving the workbook like that should work, providing the sheet is the one
selected each time the workbook is saved.

If not you could use the Workbook_Open() event like so

Private Sub Workbook_Open()
Sheet1.Activate
End Sub

This uses the workbook CodeName so should be ok no matter if the worksheet
tab name is changed

To implement check out here

http://www.nickhodge.co.uk/vba/vbaimplement.htm#eventcode

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
 
Stuart,

Nick's macro should work just fine. Since you're concerned about which
sheet is active when the workbook is opened, I suspect this is for others to
open. If there are no other macros in the workbook, you might want to just
manually select the first sheet before you save it. Workbooks open with
whatever sheet was active/selected when they were saved. That way, the
other users don't have to worry about the "...contains macros" message that
will appear. You can select the first sheet fairly quickly by holding
Ctrl-PageDown until it gets there.
 
Stuart,

Nick's macro should work just fine. Since you're concerned about which
sheet is active when the workbook is opened, I suspect this is for others to
open. If there are no other macros in the workbook, you might want to just
manually select the first sheet before you save it. Workbooks open with
whatever sheet was active/selected when they were saved. That way, the
other users don't have to worry about the "...contains macros" message that
will appear. You can select the first sheet fairly quickly by holding
Ctrl-PageDown until it gets there.

Yes, it does. Many thanks to everyone.
 
Back
Top