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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Worksheet Code

Status
Not open for further replies.

Hayton

Technical User
Oct 17, 2001
257
NZ
Hi There,

Could someone give me code that will ensure that an Excel Workbook always opens at a particular worksheet.

Any suggestions will be appreciated

Hayton McGregor

 
In the workbook open event the line
worksheets("whatever").activate
will do the trick

To get the open event opn the VBE, double click ThisWorkbook from project explorer, select Workbook from the left hand dropdown in the code window and the default 'skin' (for want of a better word!) is the open event!

;-)
If a man says something and there are no women there to hear him, is he still wrong? [ponder]
How do I get the best answers?
 
Hayton said:
Could someone give me code that will ensure that an Excel Workbook always opens at a particular worksheet.

Use Loomah's technique but keep in mind that code will only run if Macros are enabled. If the user disables macros then they will see whichever sheet was visible when the workbook was last saved.


Regards,
Mike
 
Thanks for the advice guys. The solution does what I require

Hayton McGregor

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top