Open Excel with a particular sheet to be displayed first

  • Thread starter Thread starter Sathanga
  • Start date Start date
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.
 
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
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
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
 
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
 
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


.
 

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

Back
Top