Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Open workbook with designated sheet

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Open workbook with designated sheet

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

"Jan Nordgreen" wrote in message
...
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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Open workbook with designated sheet

I suggest you put the code into a Before_Close event instead. (Don'
forget to Save too)

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Open workbook with designated sheet

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.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Open workbook with designated 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




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Open workbook with designated sheet

<<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.


---
Message posted from http://www.ExcelForum.com/

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
open to a certain sheet tab in a different workbook akay71 New Users to Excel 1 June 5th 08 05:01 PM
Search open sheets in workbook and insert into open sheet punx77 Excel Discussion (Misc queries) 0 March 6th 06 05:07 PM
Open workbook on same sheet? mevetts Excel Discussion (Misc queries) 2 December 21st 05 11:15 AM
Open workbook at a particular sheet George Gee New Users to Excel 2 October 15th 05 12:54 PM
open sheet on workbook open Stu[_31_] Excel Programming 4 October 20th 03 01:38 AM


All times are GMT +1. The time now is 05:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"