Open Workbook to Specific Sheet

D

Dennis

How can I write a macro so that each time I open an Excel
Workbook it goes to a specific specified Sheet each
time. I have a macro but if the workbook file is saved
on another sheet it will open to the last sheet used.
 
W

William

Hi Dennis

Place the code in the "ThisWorkbook" module

Private Sub Workbook_Open()
Sheets("Sheet1").Select ' Amend as necessary
End Sub

--
XL2002
Regards

William
(e-mail address removed)

| How can I write a macro so that each time I open an Excel
| Workbook it goes to a specific specified Sheet each
| time. I have a macro but if the workbook file is saved
| on another sheet it will open to the last sheet used.
 
D

Dennis

William, thanks for responding to my help message about
Excel. I tried your suggestion but can't get it to
work. I'm using Excel from Office 2000 and when I try
and save the macro you provided and use the word Private
the Macro disappears from the workbook.

My work book name is "Patrol111" and the sheet I want to
continually open to is called "Introduction". If I
create a macro as follows:

Sub Patrol111_Open()
Sheets("Introduction").Select
End Sub

The workbook accepts it but I have the same problem that
if I save the workbook while another sheet is open, the
next time I open the workbook it opens to the last sheet
it was on when I saved the file. I know it is probably a
simple fix but I can't do it for some reason. Just
getting old I guess. Anyway, thanks for your help and
any other information you can provide me would be greatly
appreicated.

Thanks again.

Dennis
 
D

Dennis

Hi Pete, thank you so much, it worked really slick and it
was easy. I'm sure what William gave me should have
worked if I had done it right. Your method was easier for
someone that doesn't know too much about macros and the
Workbook modual. Thanks again.

Regards
Dennis
 

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