Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Hide and Unhide

In my excel workbook i hv created two command buttons one is S and the other
is I
I need a code so that when i click on S button it should unhide few
sheets(X, Y, Z are the three sheets) and again second time when i click the
same S button it should hide the visible sheet(X,Y,Z)
Same way for button I, when i click on I button it should unhide few
sheets(E,F,G are the three sheets) and again second time when i click the
same I button it should hide the visible sheet(E,F,G)


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Hide and Unhide

Dear Ranjith

Use the IIF function

Sheets("X").Visible= IIf(Sheets("X").Visible,false,true)
Sheets("Y").Visible= IIf(Sheets("Y").Visible,false,true)
Sheets("Z").Visible= IIf(Sheets("Z").Visible,false,true)

If this post helps click Yes
---------------
Jacob Skaria


"Ranjith Kurian" wrote:

In my excel workbook i hv created two command buttons one is S and the other
is I
I need a code so that when i click on S button it should unhide few
sheets(X, Y, Z are the three sheets) and again second time when i click the
same S button it should hide the visible sheet(X,Y,Z)
Same way for button I, when i click on I button it should unhide few
sheets(E,F,G are the three sheets) and again second time when i click the
same I button it should hide the visible sheet(E,F,G)


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Hide and Unhide

OR

Sheets("X").Visible= not Sheets("X").Visible
Sheets("Y").Visible= not Sheets("Y").Visible
Sheets("Z").Visible= not Sheets("Z").Visible

--
If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

Dear Ranjith

Use the IIF function

Sheets("X").Visible= IIf(Sheets("X").Visible,false,true)
Sheets("Y").Visible= IIf(Sheets("Y").Visible,false,true)
Sheets("Z").Visible= IIf(Sheets("Z").Visible,false,true)

If this post helps click Yes
---------------
Jacob Skaria


"Ranjith Kurian" wrote:

In my excel workbook i hv created two command buttons one is S and the other
is I
I need a code so that when i click on S button it should unhide few
sheets(X, Y, Z are the three sheets) and again second time when i click the
same S button it should hide the visible sheet(X,Y,Z)
Same way for button I, when i click on I button it should unhide few
sheets(E,F,G are the three sheets) and again second time when i click the
same I button it should hide the visible sheet(E,F,G)


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Hide and Unhide

Did that help or am I missing something?

If this post helps click Yes
---------------
Jacob Skaria


"Ranjith Kurian" wrote:

In my excel workbook i hv created two command buttons one is S and the other
is I
I need a code so that when i click on S button it should unhide few
sheets(X, Y, Z are the three sheets) and again second time when i click the
same S button it should hide the visible sheet(X,Y,Z)
Same way for button I, when i click on I button it should unhide few
sheets(E,F,G are the three sheets) and again second time when i click the
same I button it should hide the visible sheet(E,F,G)


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
Hide/Unhide [email protected] Excel Discussion (Misc queries) 0 July 24th 08 05:02 PM
hide-unhide Office_Novice Excel Programming 0 March 18th 08 07:11 PM
hide/unhide Joanne Excel Programming 2 July 23rd 07 12:36 AM
Hide - Unhide Bob Excel Programming 0 November 16th 06 05:46 PM
Hide/unhide Jock W Excel Worksheet Functions 4 October 4th 05 05:02 PM


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

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"