If Target.Column < 4 Then (nt)
What about target.column= 6 or 9 or 11 ?
The or statement seems only to work for the last value in the range.
Re: What about target.column= 6 or 9 or 11 ?
Phil,
If you are doing slightly different things to the various coulmns, you might want to use a Select Case statement. Then you can list all your columns:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) Select Case Target.Column
Case Is = 3
MsgBox "You're in column 3"
Case Is = 1, 2, 4
MsgBox "You're in column " & Target.Column
Case Is >= 5
MsgBox "You're in column " & Target.Column
End Select
End Sub
have fun
Excellent. Thank you ! n/t
Case Is = 3 MsgBox "You're in column 3" Case Is = 1, 2, 4 MsgBox "You're in column " & Target.Column Case Is >= 5 MsgBox "You're in column " & Target.Column End Select
: The or statement seems only to work for the last value in the range.