Opening on a specific worksheet

N

NealUK

Is there any way that i can get a spreadsheet to open on, for example,
sheet5, when a shortcut icon is clicked?
I am thinking along the lines of a command line parameter.
Any help anyone can offer would be much appreciated
regards
Neal
 
O

Otto Moehrbach

Neal
You would use a Worksheet_Open macro for this. This macro would be a
part of your file. For example:
Private Sub Workbook_Open()
Sheets("MySheet").Activate
End Sub

This macro has to be placed in the Workbook module. To get there,
right-click on the icon to the left of the word "File" in the menu across
the top of the Excel window. Select View Code. Paste this macro into the
module. X-out to get back to your spreadsheet. HTH Otto
 
N

NealUK

Thanks for the reply Otto, problem is, the file itself is on the server at
work, and quite a few people access it, so i don't want to make that the
default for everyone.
I have a shortcut icon on the desktop, and was hoping that i could somehow
add a command line parameter to open at a specific sheet.
Do you know of a way this can be achieved?
Again thanks for the reply
regards
Neal
 
P

Peo Sjoblom

AFAIK you would need the workbook open event. There is no command switch
that runs a macro.
 

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