Open Workbook on Specific Worksheet

C

Chris

Hi all
I am trying to get my workbook to open on the cover sheet. I have tried to
use 2 to 3 codes but each time it comes up as run time error 9 out of range
or opens on the last sheet I was working on. what can I do?
Here is one of the codes, I have put it into the ThisWorkbook section in VBA
Projects. The Sheet is named Cover and it is the last on my list at the
bottom of the workbook and Sheet 14(Cover) in the Projects list.

Regards

Chris


Private Sub Workbook_Open()
Sheets("Cover").Activate
Range("A1").Select
End Sub
 
O

OssieMac

Hi Chris,

When you get the error does the line to activate the worksheet get
highlighted because it appears to be an incorrect worksheet name.

If so, it is probably something wrong with the worksheet name. This can be
incorrectly spelt or even a space a the start or end of the name. Try
re-naming the worksheet and ensure no leading or trailing spaces.
 
G

Gary Keramidas

just for the heck of it, try this. in a normal code module paste the
following

Sub Auto_Open()
Sheets("Cover").Activate
Range("A1").Select
End Sub

and see if it works. first just run the code and if it works, save and open
the workbook.
 
C

Chris

Ossiemac
Well That made me feel dumb.
didn,t see a space but there must have been one as I typed the name back in
it wored fine, may have had one at the end.
Thanks heaps for that
Regards
chris
 

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