Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 159
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 159
Default 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.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
target.offset(0,-1) does not work as assumed clara Excel Programming 3 June 20th 07 10:15 PM
Target cell reference moves when target is cut and pasted Illya Teideman Excel Discussion (Misc queries) 5 May 31st 07 11:34 AM
Target Address/Value Macro Won't Work Paige Excel Programming 2 February 24th 06 11:13 PM
Target.Address Doesn't Work in Excel 97? JK Excel Programming 3 September 27th 05 04:15 AM
How find if target is object in Worksheet_Change (ByVal Target As.. ?) Gunnar Johansson Excel Programming 3 July 1st 04 09:25 PM


All times are GMT +1. The time now is 07:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"