Lowell In the south
Board Regular
- Joined
- Sep 26, 2002
- Messages
- 55
I am trying to hide a columns on sheet1 and a columns on sheet2 based on a cells on sheet1. If A7 is "" then I want to hide column K on sheet1 and column P on sheet2. If A9 is "" then I want to hide column L on sheet1 and columnQ on sheet2 and so on. Here is my modification of a bit of code that kknie posted 4/30/2002 that will hide a column on sheet1 based on a cell on sheet1 but I dont know how to get it to hide the column on sheet2 also. Thanks for your help!
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count = 1 And Target.Address = "$A$7" Then
If LCase(Target.Value) = "" Then
Columns("k").EntireColumn.Hidden = True
ElseIf LCase(Target.Value)<> "" Then
Columns("k").EntireColumn.Hidden = False
End If
End If
If Target.Cells.Count = 1 And Target.Address = "$A$9" Then
If LCase(Target.Value) = "" Then
Columns("l").EntireColumn.Hidden = True
ElseIf LCase(Target.Value)<> "" Then
Columns("l").EntireColumn.Hidden = False
End If
End If
This message was edited by Lowell In the south on 2002-09-27 12:01
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count = 1 And Target.Address = "$A$7" Then
If LCase(Target.Value) = "" Then
Columns("k").EntireColumn.Hidden = True
ElseIf LCase(Target.Value)<> "" Then
Columns("k").EntireColumn.Hidden = False
End If
End If
If Target.Cells.Count = 1 And Target.Address = "$A$9" Then
If LCase(Target.Value) = "" Then
Columns("l").EntireColumn.Hidden = True
ElseIf LCase(Target.Value)<> "" Then
Columns("l").EntireColumn.Hidden = False
End If
End If
This message was edited by Lowell In the south on 2002-09-27 12:01