Open Excel with a particular sheet to be displayed first

S

Sathanga

Hi,

I have an Excel file which has 20 sheets. Is it possible
for me to open this Excel file and display Sheet10 first,
rather than the focus in whatever sheet when last saved.

Your helps are much appreciated.

Thanks & Regards
S.
 
N

Norman Harker

Hi Sathanga!

You need something like this in the ThisWorkbook module

Private Sub Workbook_Open()
Application.Goto Reference:=Sheets("Sheet10").Range("a1"),
Scroll:=True
End Sub

--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
[email protected]
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
J

JE McGimpsey

One way:

In the ThisWorkbook code module (right-click the workbook title bar and
choose View Code):

Private Sub Workbook_Open()
Sheets("Sheet10").Select
End Sub
 
S

Sathanga

Norman,

Thanks for the quickest reply. That works really very
well. But I need to go one step more. Shall i get your
expert advice for the follg.

I have modified the code a bit.

strCurSht = InputBox("Enter Sheetname", "Enter Sheetname
to Open", "")
Application.Goto reference:=Sheets(strCurSht).Range
("a1"), Scroll:=True

here, for the strCurSht, instead of InputBox, is it
possibile to get value from another application. Letsay
from a web browser !!

For eg. by creating 20 Links, which should call the same
excel file, but corresponding link should open the
corresponding sheet.

Thanks a lot for your helps.

cheers
S
 
S

Sathanga

It works. Thanks for your help McGimpsey.

-----Original Message-----
One way:

In the ThisWorkbook code module (right-click the workbook title bar and
choose View Code):

Private Sub Workbook_Open()
Sheets("Sheet10").Select
End Sub


.
 
Top