View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
David McRitchie
 
Posts: n/a
Default I need a shortcut to make a excel file open to a specific shee

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
--
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"EAHRENS" wrote in message ...
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()
Sheets("Intro").Select
End Sub

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.

"David McRitchie" wrote:

Not clear.but perhaps:

If you want to select a sheet from the Table of Contents you could
use a hyperlink, or your could use a double-click event macro.

http://www.mvps.org/dmcritchie/excel/event.htm
http://www.mvps.org/dmcritchie/excel....htm#GoToSheet

Event macros such as doubleclick are installed by right clicking on the
sheettab then inserting the code after choosing View Code.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"EAHRENS" wrote in message ...
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.

"Alan" wrote:

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

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