#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default hide sheet

I have two sheets, X and Y within a workbook. I need help
with VBA code for the following scenario:

The active sheet is Y. When I click on Sheet X I want to
automatically hide sheet Y.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default hide sheet

Hi Jeff,

Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
If Sh.Name = "Y" Then
Sh.Visible = xlSheetHidden
End If
End Sub

'This is workbok event code, which means that it needs to be
'placed in the ThisWorkbook code module, not a standard
'code module. To do this, right-click on the Excel icon at the top
'left of the Excel spreadsheet, select the View Code option from
'the menu, and paste the code in.



--

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 two sheets, X and Y within a workbook. I need help
with VBA code for the following scenario:

The active sheet is Y. When I click on Sheet X I want to
automatically hide sheet Y.



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
Create Sheet, Hide Sheet Dave Excel Discussion (Misc queries) 2 October 30th 07 03:40 PM
How do I hide a sheet, that others will not be able to see it? Petya Excel Worksheet Functions 6 January 5th 07 08:46 AM
hide sheet hitesh via OfficeKB.com Excel Discussion (Misc queries) 3 October 20th 06 02:51 PM
hide sheet tab gav meredith Excel Programming 18 April 15th 04 05:00 AM
hide sheet? uncheck sheet tabs? or ??? NetComm888 Excel Programming 1 February 10th 04 04:38 AM


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