Auto open a specified worksheet when excel is opened

matts

New Member
Joined
Sep 11, 2002
Messages
41
When an excel file is opened and it has many worksheets, it will open on the worksheet on which the file was last saved.

Is there any way I can specify that when an Excel file is opened it will always open on a specified worksheet and not the one it was last saved on.
 

Some videos you may like

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

Juan Pablo González

MrExcel MVP
Joined
Feb 8, 2002
Messages
11,959
Well, if its for a particular workbook, you can put something like this in its Open() event

Private Sub Workbook_Open()
Sheets(1).Select
End Sub
 

Gates Is Antichrist

Well-known Member
Joined
Aug 15, 2002
Messages
1,961
Private Sub Workbook_Open()
sheets("mysheet").activate
End Sub

You get to this from going alt-F11, Ctrl-R, and double-clicking the bold workbook entry. Then insert this. (untested)
 

matts

New Member
Joined
Sep 11, 2002
Messages
41
Thankyou for the speedy reply (quoted below), my only question is that I can't get this working. My worksheet that I want to open always when opening a file is called MASTER. I am not too familar with this process so I hope I word it correctly here. I go into the VB editor by pressing Alt-F11, and then on the worksheet I want as my default I double click and enter these lines. I tried replacing the (1) with the worksheet name etc but it isn't working still. Sorry about that..I would appreciate any further help you can offer.



On 2002-09-12 17:16, Juan Pablo G. wrote:
Well, if its for a particular workbook, you can put something like this in its Open() event

Private Sub Workbook_Open()
Sheets(1).Select
End Sub
 

matts

New Member
Joined
Sep 11, 2002
Messages
41
Thankyou very much....all works fine and is exactly what I needed. I apologise for my inexperience....Have a good day.

On 2002-09-12 17:50, Gates Is Antichrist wrote:
Carefully reread my post.
 

Gates Is Antichrist

Well-known Member
Joined
Aug 15, 2002
Messages
1,961
There's no need to apologize for inexperience. You took the initiative to ask and now you're rolling forward.

You know, I sometimes "cheat" when I'm not sure what to do. If you begin a code statement with
Sheets("MASTER").
then instead of typing Select, or Activate, hit Control-J (right after typing the period). The IDE then shows you your choices for continuing. Then you can separately read the help file for the choices whose names look promising.

Moreover, if you think you know which property or method you want, but aren't sure, but Ctl-J gives just *too* many choices, start typing slowly in the Ctl-J window. For example, if you hit ctl-J and then [slowly] typed the 3 letters ACT or SEL you would see the likely relevant choices move into view. Try it! Even when you become very experienced, it's often a productive way to go.
 

Watch MrExcel Video

Forum statistics

Threads
1,118,168
Messages
5,570,652
Members
412,335
Latest member
cinciri99
Top