You'd have to use a worksheet_change event:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim HideRng As Range
Set HideRng = Me.[X:AA]
With Target
If .Address < "$Y$2" Then Exit Sub
If .Value = 4 Then
HideRng.EntireColumn.Hidden = True
End If
End With
End Sub
---
Right-click on the worksheet tab, click on "View Code",
and paste in the code above. Press ALT+Q to close the VBE.
HTH
Jason
Atlanta, GA
-----Original Message-----
Can I hide 5 consecutive columns (X to AA) depending on
the content in
another cell (Hide if Y2=4, display otherwise) without
using conditional
formatting. I tried and made everything white but then
the comments remain.
Any ideas?
.
|