Open a workbook in a specific sheet

E

Emece

How can I do this? For example, I want a workbook to open
in Sheet 2 every time I open it.

Thanks!
 
G

Gord Dibben

Emece

You can use VBA Workbook_Open code to go to the specific sheet.

Right-click on the Excel Icon at top-left corner of Menu Bar. Select "View
Code. Paste this code in there. Save the file.

Sub WorkBook_Open()
WorkSheets("Sheet2").Activate
End Sub

OR use Workbook_BeforeClose code to set the worksheet as the active sheet upon
closing the workbooK.

Note: with either of the above methods the code goes into the ThisWorkbook
module, not a general or worksheet module.

In a general module you would use Sub Auto_Open() or Sub Auto_Close()

Gord Dibben XL2002
 
P

pfsardella

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