Only work if target is in particular col

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.
 
C

Claus Busch

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
 
R

robzrob

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top