Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Using Named Range in Worksheet_Change event

I have the following IF statement in my worksheet_Change event

If Not Intersect(Target, Range("A1:A20")) Is Nothing Then


I'd like to replace "A1:A20" with a named range. What do I need to change
to get this to work. Let's say the named range is "BARB" for this example.

Thanks,
Barb Reinhardt
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Using Named Range in Worksheet_Change event

try this...

If Not Intersect(Target, Range("BARB")) Is Nothing Then
--
HTH...

Jim Thomlinson


"Barb Reinhardt" wrote:

I have the following IF statement in my worksheet_Change event

If Not Intersect(Target, Range("A1:A20")) Is Nothing Then


I'd like to replace "A1:A20" with a named range. What do I need to change
to get this to work. Let's say the named range is "BARB" for this example.

Thanks,
Barb Reinhardt

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Using Named Range in Worksheet_Change event

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("BARB")) Is Nothing Then
With Target
'do your stuff
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Barb Reinhardt" wrote in message
...
I have the following IF statement in my worksheet_Change event

If Not Intersect(Target, Range("A1:A20")) Is Nothing Then


I'd like to replace "A1:A20" with a named range. What do I need to

change
to get this to work. Let's say the named range is "BARB" for this

example.

Thanks,
Barb Reinhardt



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
Worksheet_Change Event with Range Protection Judy P. Excel Discussion (Misc queries) 3 October 28th 10 08:07 PM
Lock or Unlock Range of Cells on Worksheet_Change Event Grahame Coyle Excel Worksheet Functions 3 July 14th 08 12:27 AM
Change event triggered by a named range Sean Excel Programming 4 August 1st 05 03:01 AM
Change Event on a named range GregR Excel Programming 2 July 12th 05 09:37 PM
Worksheet_Change Event Sam Excel Programming 2 November 21st 03 06:51 PM


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

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

About Us

"It's about Microsoft Excel"