open sheet on workbook open

  • Thread starter Thread starter Stu
  • Start date Start date
go in the the workbook sheet and pick

Private Sub Workbook_Open()

end sub

in side this procudure write what you want the workbook to
do when it is opened

Jase
 
Stu

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("Sheet3").Activate
End Sub

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

Note: with either method 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()

BTW........most of this was answered by Tom and Chip on October 15th in answer
to your post "How to get a macro to run when a document is closed or opened"

http://groups.google.com/[email protected]

Gord Dibben XL2002
 
Sub Auto_Open()
Worksheets("sheet1").Activate
End sub

placed in a general module. Or to use the Workbook_Open Event, go to the
project explorer and double click on the ThisWorkbook entry for your project

In the left dropdown at the top, select Workbook, in the Right, Open

Private Sub Workbook_Open()
Worksheets("sheet1").Activate
End Sub
 
Back
Top