View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
SIGE SIGE is offline
external usenet poster
 
Posts: 206
Default Hide / Unhide Columns with checkbox

Hi There,

1. I have a checkbox placed on a sheet -via the Control Toolbox- and
following code for the sheet:

Private Sub CheckBox1_Click()
If CheckBox1 = True Then
Run "GSVHide"
Else
Run "GSVUnHide"
End If
End Sub

2. I have 2 subs under a standard module:

Sub GSVHide()
ActiveSheet.Range("B:B").EntireColumn.Hidden = True
End Sub
Sub GSVUnHide()
ActiveSheet.Range("B:B").EntireColumn.Hidden = False
End Sub

= It Bugs:
Run-time Error 1004:
Unable to set Teh Hidden Propertyof The RAnge Class

- "No" my checkbox is not in a column/ row that is supposed to be
hidden!
- "No" my sheets nor workbook are protected
*? Working in Excel 97 Sr2
*? Is there a problem with my references perhaps?


Any suggestions please Sige