I would like a button to be pressed that would hide specific columns. Once the button is pressed again, the columns appear.
This is what I was attempting to use. I would like the indicated columns (I:X) to hide upon pressing the button, then all of the columns to show again once pressed again. Ideally, the button could also be labeled to show "Hide Information" and "Show Information" correctly.![]()
Sub Hide() ' ' Macro1 Macro ' ' If ActiveSheet.Shapes.Range(Array("Button 1")).Caption = "Teamwise Dashboard Hide" Then Range("I:X").EntireColumn.Hidden = True ActiveSheet.Shapes.Range(Array("Button 1")).Caption = "Teamwise Dashboard Show" Else Range("I:X").EntireColumn.Hidden = False ActiveSheet.Shapes.Range(Array("Button 1")).Caption = "Hide Information" End If End Sub
But I get run time error 438' Object doesnt support this property or method. on below line..
Where am I failing here?![]()
If ActiveSheet.Shapes.Range(Array("Button 1")).Caption = "Teamwise Dashboard Hide" Then
Thanks,
Shiva
Bookmarks