ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Only work if target is in particular col (https://www.excelbanter.com/excel-programming/447762-only-work-if-target-particular-col.html)

robzrob

Only work if target is in particular col
 
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.

Claus Busch

Only work if target is in particular col
 
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
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2

robzrob

Only work if target is in particular col
 
On Saturday, 1 December 2012 10:52:03 UTC, Claus Busch wrote:
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

--

Win XP PRof SP2 / Vista Ultimate SP2

Office 2003 SP2 /2007 Ultimate SP2


Aha! Vielen dank.


All times are GMT +1. The time now is 06:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com