Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Command button unhides but not hides
Hello I have command button . what I want to do is; hide or unhide the
sheet. If I select the button it should unhide the sheet, but if I select the button again to hide the sheet Below is my code the first 2 rows by themselves unhide the sheet but When I added the last 2 rows the code it does not work. Thanks in advance Private Sub CommandButton1_Click() Sheets("2008 Complete").Visible = True Sheets("2008 Complete").Select Sheets("2008 Complete").Visible = False Sheets("Summary-Sheet").Select End Sub |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Command button unhides but not hides
You can do it with just this one line of code. This will toggle the
visibility back and forth with subsequent clicks... Sheets("2008 Complete").Visible = Not Sheets("2008 Complete").Visible -- HTH... Jim Thomlinson "Wanna Learn" wrote: Hello I have command button . what I want to do is; hide or unhide the sheet. If I select the button it should unhide the sheet, but if I select the button again to hide the sheet Below is my code the first 2 rows by themselves unhide the sheet but When I added the last 2 rows the code it does not work. Thanks in advance Private Sub CommandButton1_Click() Sheets("2008 Complete").Visible = True Sheets("2008 Complete").Select Sheets("2008 Complete").Visible = False Sheets("Summary-Sheet").Select End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
COMMAND BUTTON | New Users to Excel | |||
Using a command button to add | Excel Discussion (Misc queries) | |||
Button hides unhides columns, how? | Excel Discussion (Misc queries) | |||
Command Button | New Users to Excel | |||
Command Button | Excel Discussion (Misc queries) |