Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

specify one excel sheet in an excel file to be active 1

Status
Not open for further replies.

seaport

MIS
Jan 5, 2000
923
US
How can I specify one excel sheet in an excel file (that has multiple sheets) to be active in the runtime when the excel file is opened? I mean assigning the active worksheet dynamically.

The ActiveSheet property of the excel workbook is read-only.

Thanks in advance.

Seaport
 
You can do this with VBA.
Go to the VB Editor
Select Insert>Module
Put this code into the module, changing the sheet name (in quotes) to suit your needs.
Code:
Sub Auto_Open()
    Sheets("Sheet1").Select
End Sub
The only downside to this is that you will be warned for macros when you open the file. You can turn off the macro virus protection to avoid this, but I would not recommend doing that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top