Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm making a toolbar dynamically to hide columns of a workbook. If I
use Columns(i).Hidden = True|False, it works. If I use it in the below sub (set to the .OnAction of the toolbar button), it doesn't work correctly, although the sub continues to run past it. The .Tag nonsense was because it was getting fired twice per button click, so I added that to keep track of the button's clicked state more accurately. Any ideas on why my column won't hide? Sub ButtonToggle() Dim ctlPressed As CommandBarButton Dim i As Long Set ctlPressed = Application.CommandBars.ActionControl With ctlPressed i = .index + 1 If .Tag = "0" Then If .State = msoButtonDown Then .State = msoButtonUp Else .State = msoButtonDown End If Columns(i).Hidden = .State .Tag = "1" Else .Tag = "0" End If End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
2007 Worksheet, Hidden Columns, .CSV Format Saves Hidden Column Da | Excel Discussion (Misc queries) | |||
Copy and Paste with hidden columns remaining hidden | Excel Discussion (Misc queries) | |||
Hidden rows columns won't stay hidden | Excel Worksheet Functions | |||
Hidden Columns No Longer Hidden after Copying Worksheet? | Excel Discussion (Misc queries) | |||
How to keep hidden columns hidden using protection | Excel Discussion (Misc queries) |