Only work if target is in particular col

  • Thread starter Thread starter robzrob
  • Start date Start date
R

robzrob

Hello

Trying to make part of a macro work only if the target is in col B, otherwise exit. I'm doing this:

If Target.Column <> B Then Exit Sub

Have also tried this:

If Target.Address.Column <> B Then Exit Sub

but neither work.
 
Hi,

Am Sat, 1 Dec 2012 02:41:48 -0800 (PST) schrieb robzrob:
Trying to make part of a macro work only if the target is in col B, otherwise exit. I'm doing this:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 2 Then Exit Sub
Your Code
End Sub


Regards
Claus Busch
 
Hi,



Am Sat, 1 Dec 2012 02:41:48 -0800 (PST) schrieb robzrob:






Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Column <> 2 Then Exit Sub

Your Code

End Sub





Regards

Claus Busch

--

Win XP PRof SP2 / Vista Ultimate SP2

Office 2003 SP2 /2007 Ultimate SP2

Aha! Vielen dank.
 
Back
Top