Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default On Open/On Close

I have three sheets: X, Y, & Z. The only sheet I want
visible when first opened or when closed is sheet X. What
would the VBA code look like to accomplish this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default On Open/On Close

Jeff,

You can use

Worksheets("You Sheet").Activate

at the begging of your macro and when you close.


HTH


Charle

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default On Open/On Close

One way, Jeff,

In the code module for ThisWorkbook:

'*****
Option Explicit
Private Sub Workbook_Open()
Dim wks As Worksheet
For Each wks In Me.Worksheets
If wks.Name < "Sheet1" Then wks.Visible = xlSheetHidden
Next
End Sub
'*****

You may enter the same code in Workbook_Close as well, so the sheets will not be
visible if the workbook is opened with macros disabled.-

HTH
Anders Silven


"Jeff" skrev i meddelandet
...
I have three sheets: X, Y, & Z. The only sheet I want
visible when first opened or when closed is sheet X. What
would the VBA code look like to accomplish this?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default On Open/On Close

I replied to your earlier post. What was wrong with that suggestion?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Jeff" wrote in message
...
I have three sheets: X, Y, & Z. The only sheet I want
visible when first opened or when closed is sheet X. What
would the VBA code look like to accomplish this?



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 and close files Chi Excel Worksheet Functions 2 May 28th 09 09:46 PM
How do I close all open spreadsheets at once? cbh Excel Discussion (Misc queries) 13 January 12th 08 11:30 PM
Slow to open /close George Gee New Users to Excel 3 May 8th 05 10:29 PM
How can I close only 1 workbook when I have many open? jpt consulting Excel Discussion (Misc queries) 3 November 30th 04 11:58 PM
run macro on close & open Stu[_27_] Excel Programming 3 October 15th 03 02:09 PM


All times are GMT +1. The time now is 09:09 PM.

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

About Us

"It's about Microsoft Excel"