Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default open sheet on workbook open

How do I set a macro to open a specific sheet each time the XL file is
opened?

Thanks
--
Stu


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default open sheet on workbook open

Private Sub Workbook_open()
Sheet(whichever).activate
End Sub
"Stu" wrote in message
...
How do I set a macro to open a specific sheet each time the XL file is
opened?

Thanks
--
Stu




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default open sheet on workbook open

go in the the workbook sheet and pick

Private Sub Workbook_Open()

end sub

in side this procudure write what you want the workbook to
do when it is opened

Jase


-----Original Message-----
How do I set a macro to open a specific sheet each time

the XL file is
opened?

Thanks
--
Stu


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default open sheet on workbook open

Stu

You can use VBA Workbook_Open code to go to the specific sheet.

Right-click on the Excel Icon at top-left corner of Menu Bar. Select "View
Code. Paste this code in there. Save the file.

Sub WorkBook_Open()
WorkSheets("Sheet3").Activate
End Sub

OR use Workbook_BeforeClose code to set the worksheet as the active sheet upon
closing the workbooK.

Note: with either method the code goes into the ThisWorkbook module, not a
general or worksheet module.

In a general module you would use Sub Auto_Open() or Sub Auto_Close()

BTW........most of this was answered by Tom and Chip on October 15th in answer
to your post "How to get a macro to run when a document is closed or opened"

http://groups.google.com/groups?selm...rum-nospam.com

Gord Dibben XL2002

On Mon, 20 Oct 2003 00:50:39 +0100, "Stu" wrote:

How do I set a macro to open a specific sheet each time the XL file is
opened?

Thanks


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default open sheet on workbook open

Sub Auto_Open()
Worksheets("sheet1").Activate
End sub

placed in a general module. Or to use the Workbook_Open Event, go to the
project explorer and double click on the ThisWorkbook entry for your project

In the left dropdown at the top, select Workbook, in the Right, Open

Private Sub Workbook_Open()
Worksheets("sheet1").Activate
End Sub

--
Regards,
Tom Ogilvy

Stu wrote in message
...
How do I set a macro to open a specific sheet each time the XL file is
opened?

Thanks
--
Stu




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
How can I set a workbook to open always with a certain sheet I wan Shariq Setting up and Configuration of Excel 1 December 20th 06 09:01 AM
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


All times are GMT +1. The time now is 06:44 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"