Always display a particular worksheet upon opening Excel 2003

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a Excel document that contains multiple worksheets.
When I open the document, I want it to always open with a particular
worksheet displayed (rather than the one displayed when I last saved the
document).

How do I achieve this please?
 
Private Sub Workbook_Open()
Thisworkbook.Worksheets("sheet_name").Activate
End Sub

This is workbook event code.
To input this code, right click on the Excel icon on the worksheet
(or next to the File menu if you maximise your workbooks),
select View Code from the menu, and paste the code


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Thanks for your reply Bob.
However I've entered the code as you described (replacing ''sheet_name''
with my sheet name - i've tried with and without quotation marks & brackets)
& it hasn't worked.
Any suggestions please?
 
What does doesn't work mean, it errors, the same sheet as you closed with is
active?

Post your EXACT code, and the EXACT names of your worksheets please.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Hi Bob,

'Doesn't work' tends to mean it is doing the same thing it was before
I asked for assistance
Ie, Opening on the same worksheet that I was on when I save the document.

However I've worked it out, and unfortunately you didn't tell me one detail
that would have made your suggestion work. This was to change the drop-down
menu from 'General' to 'Worksheet' in the VisualBasic (View code) window, and
then paste the code.

Thanks for your help with this. It is much appreciated.
Regards
Ian
 
'Doesn't work' tends to mean it is doing the same thing it was before
I asked for assistance

Really, thanks for letting us know what "Doesn't work" means
Ie, Opening on the same worksheet that I was on when I save the document.

However I've worked it out, and unfortunately you didn't tell me one
detail
that would have made your suggestion work. This was to change the
drop-down
menu from 'General' to 'Worksheet' in the VisualBasic (View code) window,
and
then paste the code.

If you had copied and pasted the code correctly, General would automatically
changed to Workbook meaning it is not necessary to first select Workbook
from the dropdown, so in fact Bob gave you correct information but you
either misunderstood or handled it incorrectly. The error was between the
chair and the PC.


Have a nice day!


--


Regards,


Peo Sjoblom



He told you to
 
Peo,
Before you send such a response, please check the full thread.
Bob's last email to me was the one which started being patronizing.
Bob, if anything, had started to complicate the issue by asking what was
shown.
Well it didnt take a lot of thought to realise that 'doesn't work' means it
was doing the same thing when I asked for assistance.
I work in IT and realise that exact details are important, however sometimes
you need to let common sense prevail and not over complicate things.
Anyway, I did exactly follow Bob's instructions, by both typing & cut &
pasting (but of course changing the worksheet to mine) the code into View
Code window but it did not work.
Don't want to dwell on this any longer so please consider this the last
communication.
Thanks for both Bob's & your time on this.
Regards
Ian
 
I am sorry, but there was nothing patronising about my response. I was just
being precise because as responders we have no idea how knowledgeable the OP
is, how capable they are, or anything. I give my time freely, so I want to
mitigate that time usage, and it saves time and back and forth responses.

And you said change the drop-down menu from General to Worksheet. The code
I gave was workbook code, there is no Worksheet in that module to select.
So, either you were being imprecise, or you did it wrong.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Back
Top