I need a shortcut to make a excel file open to a specific sheet

G

Guest

I need to know how to modify an excel shortcut to make a file always open to
a specific named "intro" sheet.
 
A

Alan

You cant do this in a shortcut as far as I know, but this code in the VB
editor 'This Workbook' will do the trick,
Post back if you're unfamiliar with VB code,
Regards,
Alan.
Private Sub Workbook_Open()
Sheets("Intro").Select
End Sub
 
G

Guest

This worked great. I am also running a macro that forces a user to enter a
new name and excel then changes the file to that name and goes to the table
of contents. Is there a way to write a macro that will also change the macro
you gave me to change from the "intro" sheet to the "table of contents sheet"
when the file is saved under the new name.
 
G

Guest

I may not have worded my request properly. I am using the follwoing macro to
make an excel workbook open to a specific worksheet called intro. Private
Sub Workbook_Open()The intro sheet then promts the user to enter a new name and the entire
workbook is then renamed, via a macro, and then the newly named file displays
the table of contents work sheet. My problem is when the newly named file is
closed and reopened, it goes to the intro sheet. I need to know how to
automaticaly change the macro that opens the intro sheet to automatically
open the table of contents sheet.
 
D

David McRitchie

since I got a non zero error return code in Excel 2002 even if the sheet was found
I will just put the sheets in an order so that the last one is the most preferred,
as I understand the question.

Right click on the logo to the left of the menu from Excel to open Thisworkbook
place the following code after Option Explicit

Sub WorkBook_Open()
On Error Resume Next
Sheets(1).Select '-- 1st worksheet
Sheets("intro").Select
Sheets("toc").Select
On Error GoTo 0
End Sub
 
G

Guest

I am in the presence of genius. Thanks

David McRitchie said:
since I got a non zero error return code in Excel 2002 even if the sheet was found
I will just put the sheets in an order so that the last one is the most preferred,
as I understand the question.

Right click on the logo to the left of the menu from Excel to open Thisworkbook
place the following code after Option Explicit

Sub WorkBook_Open()
On Error Resume Next
Sheets(1).Select '-- 1st worksheet
Sheets("intro").Select
Sheets("toc").Select
On Error GoTo 0
End Sub
 
D

David McRitchie

Hardly. The shorter more efficient code is from experimental failure trying to use error codes..
 

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