I am trying to hide columns when the value in a row is greater than value in a specfic cell. I modified code that I found on the forum to achieve this but somehow just can get it to fire. As I change the value in the specified cell all columns remain visible. The code I modified is shown below and comes from the following post.
http://www.excelforum.com/excel-prog...ll-result.html
I am a bit of a newbie at this but can generally follow what's going on in the code... the Dummies book helped a bunch!
'Hides the a column when the value in row 6 (D6:Z6) is greater than value in cell B3
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count < 1 Then Exit Sub
If Union(Range("$D$6:$Z$6"), Target).Address = Range("$D$6:$Z$6").Address Then
If Target.Value > Range("$B$3") Then Target.EntireColumn.Hidden = True
End If
End Sub
Thanks very much for your help!
--MrV
Bookmarks