Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Second Click on Control Button
Greetings!
I made a control button that will unhide a column in a certain range using: Private Sub CommandButton2_Click() Columns("B").Select Selection.EntireColumn.Hidden = False Range("B1").Select End Sub How can I modify this to re-hide the column on the second click, or if it his already unhidden? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Second Click on Control Button
Private Sub CommandButton2_Click()
With Columns(2) .EntireColumn.Hidden = Not .EntireColumn.Hidden End With Range("B1").Select End Sub Gord Dibben MS Excel MVP On Tue, 1 Aug 2006 14:30:02 -0700, iamjbunni wrote: Greetings! I made a control button that will unhide a column in a certain range using: Private Sub CommandButton2_Click() Columns("B").Select Selection.EntireColumn.Hidden = False Range("B1").Select End Sub How can I modify this to re-hide the column on the second click, or if it his already unhidden? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Second Click on Control Button
Private Sub CommandButton2_Click()
With Columns("B") .Hidden = Not .Hidden End With Range("B1").Select End Sub -- HTH Bob Phillips (replace xxxx in the email address with gmail if mailing direct) "iamjbunni" wrote in message ... Greetings! I made a control button that will unhide a column in a certain range using: Private Sub CommandButton2_Click() Columns("B").Select Selection.EntireColumn.Hidden = False Range("B1").Select End Sub How can I modify this to re-hide the column on the second click, or if it his already unhidden? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Second Click on Control Button
Give this a try...
Private Sub CommandButton2_Click() With Columns("D") If .Hidden = True Then CommandButton2.Caption = "Hide Column" .Hidden = False Else CommandButton2.Caption = "Un-Hide Column" .Hidden = True End If End With End Sub -- HTH... Jim Thomlinson "iamjbunni" wrote: Greetings! I made a control button that will unhide a column in a certain range using: Private Sub CommandButton2_Click() Columns("B").Select Selection.EntireColumn.Hidden = False Range("B1").Select End Sub How can I modify this to re-hide the column on the second click, or if it his already unhidden? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Second Click on Control Button
Thank you!
"Gord Dibben" wrote: Private Sub CommandButton2_Click() With Columns(2) .EntireColumn.Hidden = Not .EntireColumn.Hidden End With Range("B1").Select End Sub Gord Dibben MS Excel MVP On Tue, 1 Aug 2006 14:30:02 -0700, iamjbunni wrote: Greetings! I made a control button that will unhide a column in a certain range using: Private Sub CommandButton2_Click() Columns("B").Select Selection.EntireColumn.Hidden = False Range("B1").Select End Sub How can I modify this to re-hide the column on the second click, or if it his already unhidden? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
right-click on a control button and view code does nothing | Excel Worksheet Functions | |||
Add control to right click menu when something is on the clipboard | Excel Programming | |||
Why does the click event get control? | Excel Programming | |||
Create floating button based on button click in menu | Excel Programming | |||
Click on Image Control disables it | Excel Programming |