Open workbook with designated sheet

  • Thread starter Thread starter Jan Nordgreen
  • Start date Start date
J

Jan Nordgreen

I Use winxp and excel2000.

I would like my workbook to always open with the sheet called "panel de
control", so I have tried:

Private Sub Workbook_Open()
Sheets("panel de control").Select
End Sub

It opens with the sheet I was in when I saved the file last time, and then
switches to the sheet "panel de control".

To avoid seeing the sheet I was in when I saved last, I have tried:

Private Sub Workbook_Open()
Application.ScreenUpdating = False
Sheets("panel de control").Select
Application.ScreenUpdating = True
End Sub

That did not improve things.

Any suggestions?

Sincerely,

Jan Nordgreen
 
Try this, Jan (not private); works fine for me:

Sub workbook_open()
Sheets("panel de control").Select
End Sub

<-*-><-*-><-*-><-*-><-*-><-*-><-*-><-*->
Hope this helps!
Anne Troy (better known as Dreamboat)
Author: Dreamboat on Word
Email: Dreamboat*at*Piersontech.com
Web: www.TheOfficeExperts.com
 
I suggest you put the code into a Before_Close event instead. (Don'
forget to Save too)
 
Try

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Sheets("panel de control").Select
End Sub

This will mean that the file is always saved with the required sheet selected and will therefore always open on that sheet.
 
Thanks for the answers.

To put code in beforeclose does not help. When you open a workbook it will
open on the sheet you were on when you last saved it, not when you last
closed it.

To put code in beforesave is not very practical. It would mean that you
would change sheet every time you saved the workbook.

I guess a way to go would be to manipulate the information Excel uses to
determine which worksheet to open, but I don't know how.


Regards,

Jan Nordgreen
 
<<When you open a workbook it will
open on the sheet you were on when you last saved it>>

That is why I suggested you add a line to save the file.
 

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

Back
Top