Setting Start Sheet in VB

Schodoodles

New Member
Joined
Jan 25, 2005
Messages
17
Hi,

Is there anyway to set a start sheet when you open up excel?
I've checked the boards but not much seems to be working for me :(

The code I've been trying to use is this on a worksheet called 'Intro Sheet' that has a few menus.

Code:
Private Sub Workbook_Open()
Application.Goto ("Intro Sheet")
End Sub

If I pop this in the workbook area - will the scroll lock code I have put on the sheet's own VB code list still work; it looks like this;
Code:
Private Sub Worksheet_Activate()
Worksheets("Intro Sheet").ScrollArea = "A1:A20"
End Sub

Thanks!!
Scho
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Cbrine

Well-known Member
Joined
Dec 2, 2003
Messages
3,196
Private Sub Workbook_Open()
Sheets("Intro Sheet").activate
End sub

The goto might work as well, but I've never used it.

The worksheet_activate code will still work.

HTH
Cal
 

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
Why not just combine them:

<font face=Tahoma><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> Workbook_Open()
    Application.Goto [<SPAN style="color:#007F00">'Intro Sheet'!A1]</SPAN>
    ActiveSheet.ScrollArea = "A1:A20"
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>

HTH,

Smitty

{Edit: Heya Cal!}
 

Schodoodles

New Member
Joined
Jan 25, 2005
Messages
17

ADVERTISEMENT

Can do but no worries.

I do seem to be having a problem though.

I've used the basic code that Cbrine gave me but it seems to be popping up an error for no apparent reason - Is it me!!!??? :oops:

Anyway; the code;
Code:
Private Sub Workbook_Open()
Sheets("Intro Sheet").Activate
End Sub

The error window says;
Run-time erro '57121'
Application-defined or object-defined error.

I can click end and its all fine but it doesnt get rid of the fact something is wrong. I'm also a newbie at this kinda stuff and havent got a clue why its stopped working now - it worked at least once honest!!

Scho
 

Schodoodles

New Member
Joined
Jan 25, 2005
Messages
17
Well you got me there - thats the only code in the 'Thisworkbook' bit - every other bit of code is sheet relelvant as far as I know.

But it highlights that bit of code in yellow when I click the debug box.

Time for the GoTo function?? :confused:
 

Forum statistics

Threads
1,148,525
Messages
5,747,188
Members
424,068
Latest member
Salim khamis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top