ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   action on open (https://www.excelbanter.com/excel-programming/437253-action-open.html)

Greg Sottile

action on open
 
I have a workbook with multiple worksheets. Upon open, can I force a
specific worksheet to be current? Typically which ever sheet was current
when last saved is the current sheet on open.

Sam Wilson

action on open
 
Yep,

Press Alt + F11 to bring up the VB editor, find your workbook in the project
window and right click it then "View Code" - paste this in:

Private Sub Workbook_Open()

worksheets("Whatever Sheet you want").activate

End Sub


Sam

"Greg Sottile" wrote:

I have a workbook with multiple worksheets. Upon open, can I force a
specific worksheet to be current? Typically which ever sheet was current
when last saved is the current sheet on open.


Bernard Liengme

action on open
 
You did not say what version of Excel. This applies to XL 2003 (and down to
XL 1997)
1 Right click the green X Excel logo to the left of the File item on the
menu
2 Select View Code
3 Copy this subroutine into the module window
Private Sub Workbook_Open()
Sheets("Sheet3").Select
End Sub

4 Modify the middle line to suit your needs
5 You many need to reset you macro security for the subroutine to run when
you open the file
bet wishes
--
Bernard Liengme
http://people.stfx.ca/bliengme
Microsoft Excel MVP

"Greg Sottile" wrote in message
...
I have a workbook with multiple worksheets. Upon open, can I force a
specific worksheet to be current? Typically which ever sheet was current
when last saved is the current sheet on open.




All times are GMT +1. The time now is 01:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com