Here's a simple example. If the user double-clicks A1,
then the column G thru J will hide/unhide.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target _
As Range, Cancel As Boolean)
If Not Intersect(Me.[A1], Target) Is Nothing Then
If Me.[G:J].EntireColumn.Hidden = True Then
Me.[G:J].EntireColumn.Hidden = False
Else
Me.[G:J].EntireColumn.Hidden = True
End If
End If
End Sub
---
To use, right-click on the worksheet tab, go to View
Code, and paste in the code above. Press ALT+Q to return
to Excel.
HTH
Jason
Atlanta, GA
-----Original Message-----
I need to hide a section of a worksheet to make it more
simple to understand.
But I also want to display the hidden sections if
needed , preferably by
ticking a box?
Any ideas? Thanks in advance.
.
|