on open, always display sheet1

G

Guest

Hi

is it possible to always force a particular worksheet to be the visible
active one every time the spreadsheet is opened?

So for example if I have sheet1 and sheet2, and save the spreadsheet while
in sheet2, the next time I open the spreadhseet, I want to force sheet1 to be
the visible sheet.

is there some sort of 'on-open' function I could use with a macro that
directs to sheet1?

thanks for any help
 
A

AP

Try this macro:

Sub Auto_open()
Sheets(1).select
cells(1,1).select 'If you want it to go to the A1 cell
End Sub

Cheers,
AP
 
P

paul.robinson

Hi
In Excel, go to Tools, Macro, Visual Basic Editor. Double click
ThisWorkbook for your excel file. If you cannot see the excel file
name, go to View, Project Explorer.
In the drop down at the top which says (General) choose the Workbook
option. You will be given this empty macro:

Private Sub Workbook_Open()

End Sub

which is the macro you hope exists!
Inside this put
worksheets("MyworksheetName").Activate

where you have already called one of your sheets "MyworksheetName".

regards
Paul
PS if you are distributing this workbook, users may get a security
warning. Tell them to go to Tools, Macro, Security. Set the protection
to Medium in Security Level and in the Trusted Publishers section they
need to "Trust access to visual basic project". Save the file, close it
and reopen.
 

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