Hi,
I am trying to hide column 'E' when either cell C8 or C16 is empty and show it when both cells are completed. The following code doesn't quite work.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$C$16" And Target.Value = "" Or Target.Address = "$C$8" And Target.Value = "" Then
Range("E:E").EntireColumn.Hidden = True
ElseIf (Target.Address = "$C$16" And Target.Value <> "") And (Target.Address = "$C$8" And Target.Value <> "") Then
Range("E:E").EntireColumn.Hidden = False
End If
End Sub
I think its to do with the 'And' in the ElseIf statement but I don't know much about VBA so I could do with some help. Thanks
Bookmarks