Start a file at a defaulted worksheet/cell?

  • Thread starter Thread starter Kevin
  • Start date Start date
K

Kevin

Howdy,

Having a few users to a file, can I have the file open to a default
worksheet/cell as I have directions I want them to read before playing...

Regards,
Kevin
 
Kevin, use something like this, put in thisworkbook code

Private Sub Workbook_Open()
Sheets("Sheet2").Select
Range("C3").Select
End Sub

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
 
Thanks for the reply Paul...

Unfortunately I'm not super familiar with "code." Can you direct me there
please...

Thanks again,
Kevin
 
Kevin,

The code must be entered in the code window of the workbook,

- open the VBA Editor - Alt+F11
- in the Project Browser (View>Project Browser if not already visible), find the
workbook name and expand it until you see "ThisWorkbook"
- double-click ThisWorkbook (window name should be <YourWorkbookName -
ThisWorkbook (Code)) and paste the code:

'*****
Private Sub Workbook_Open()
Sheets("Sheet1").Activate
Range("A1").Select
End Sub
-*****

- save, close and re-open the file; it will land in A1 on Sheet1, adjust to
suit.

HTH
Anders Silven
 
I must be brain fart'n cause it is not working for me..... It took me a sec
to figure out where to go, and I even put the code in a few places to test
it.... to no avail however. Any further suggestions, perhaps you can send
me a little example.... You have me e-mail addy below...

ty, Kev
 
Kevin,
To put in this macro, from your workbook right-click the workbook's icon and
pick View Code. This icon is to the left of the "File" menu this will open
the VBA editor, in the left hand window double click on thisworkbook, under
your workbook name, and paste the code in the window that opens on the right
hand side, press Alt and Q to close this window and go back to your
workbook, now this will run every time you open the workbook. If you are
using excel 2000 or newer you may have to change the macro security
settings to get the macro to run. Per your request I also sent you a file
with it in it

Private Sub Workbook_Open()
Sheets("Sheet2").Select
Range("C3").Select
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
 
I lowered my security to enable or disable macros and now I get a:

Run-time error '9':
Subscript out of range.

Making progress anyways...

Kev

P.S. I didn't get that file? there are two underscores in my e-mail addy...
 
I lowered my security to enable or disable macros and now I get a:

Run-time error '9':
Subscript out of range.

Then when I do a Debug it highlights the Sheets line in yellow... what is
wrong with it?

Private Sub Workbook_Open()
* Sheets("Sheet2").Select
Range("A1").Select
End Sub

Making progress anyways...

Kev
 
Run-time error '9':
Subscript out of range.

Then when I do a Debug it highlights the Sheets line in yellow... what is
wrong with it?

Private Sub Workbook_Open()
* Sheets("Sheet2").Select
Range("A1").Select
End Sub

If there is not a worksheet named "Sheet2" in the workbook you will get the
above error. Change "Sheet2" to the name of the worksheet you want to show when
the workbook is opened.

Regards,
Anders Silven
 
Kevin, sent you the file again, but I think if you change the sheet name to
your sheet name as Anders said you will get it to work

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
 
Back
Top