Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi
I'm wondering how I do this: I want one userbutton on a spreadsheet where, if columns D - H are hidden, the button unhides them, or if they are visible it hides them. Does anyone have any advice, please? Thanks in advance Steve |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Insert this line in the button's code module:
Columns("D:H").EntireColumn.Hidden = Not Columns("D:H").EntireColumn.Hidden Regards, Stefi €žSteve€ť ezt Ă*rta: Hi I'm wondering how I do this: I want one userbutton on a spreadsheet where, if columns D - H are hidden, the button unhides them, or if they are visible it hides them. Does anyone have any advice, please? Thanks in advance Steve |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Oct 21, 8:37*pm, Steve wrote:
Hi I'm wondering how I do this: I want one userbutton on a spreadsheet where, if columns D - H are hidden, the button unhides them, or if they are visible it hides them. Does anyone have any advice, please? Thanks in advance Steve ActiveSheet.Range("D:H").EntireColumn.Hidden = Not (ActiveSheet.Range("D:H").EntireColumn.Hidden) Ken Johnson |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Oct 21, 8:54*pm, Ken Johnson wrote:
On Oct 21, 8:37*pm, Steve wrote: Hi I'm wondering how I do this: I want one userbutton on a spreadsheet where, if columns D - H are hidden, the button unhides them, or if they are visible it hides them. Does anyone have any advice, please? Thanks in advance Steve ActiveSheet.Range("D:H").EntireColumn.Hidden = Not (ActiveSheet.Range("D:H").EntireColumn.Hidden) Ken Johnson But this is neater... With ActiveSheet.Columns("D:H") .Hidden = Not .Hidden End With Ken Johnson |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Steve,
You could also change the button caption Private Sub CommandButton1_Click() With ActiveSheet.Columns("D:H") .Hidden = Not .Hidden If .Hidden Then CommandButton1.Caption = "Show" Else CommandButton1.Caption = "Hide" End If End With End Sub Mike "Steve" wrote: Hi I'm wondering how I do this: I want one userbutton on a spreadsheet where, if columns D - H are hidden, the button unhides them, or if they are visible it hides them. Does anyone have any advice, please? Thanks in advance Steve |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to perform caculations using database functions in this case | Excel Discussion (Misc queries) | |||
Using a formula to perform multiple functions. | Excel Discussion (Misc queries) | |||
Can you perform Math functions with ActiveX Checkbox controls? | Excel Worksheet Functions | |||
Are there functions that perform robust statistics in Excel? | Excel Worksheet Functions | |||
Perform functions on the result of adding two columns | Excel Worksheet Functions |