Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Test if Cell is within Range (name)


I have a dynamic range (meaning the size will change) that is defined
with a name. How can I easily test if an active cell is within that
range?

Thanks,

'expl:

'Range B2:Z15 (name "TESTRANGE")

'ActiveCell D4

'Test if D4 is within "TESTRANGE"


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 320
Default Test if Cell is within Range (name)

If Application.Intersect(Range("TESTRANGE"),Range("D4 ")) is Nothing then
msgbox "Does not intersect"
Else
msgbox "Intersects"
End If

Bob Umlas
Excel MVP

"goepf" wrote in message
...

I have a dynamic range (meaning the size will change) that is defined
with a name. How can I easily test if an active cell is within that
range?

Thanks,

'expl:

'Range B2:Z15 (name "TESTRANGE")

'ActiveCell D4

'Test if D4 is within "TESTRANGE"


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step guide to

creating financial statements


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Test if Cell is within Range (name)

Dim Isect As Range
Set Isect = Application.Intersect(Range1, Range2)
If isect is nothing then
Do this
Else
Do that
End if

Lars Kofod
-----Original Message-----

I have a dynamic range (meaning the size will change)

that is defined
with a name. How can I easily test if an active cell is

within that
range?

Thanks,

'expl:

'Range B2:Z15 (name "TESTRANGE")

'ActiveCell D4

'Test if D4 is within "TESTRANGE"


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from

http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by

step guide to creating financial statements
.

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
How can I test for nulls within a range without specifying each ce Houston Excel Discussion (Misc queries) 2 March 25th 10 05:50 PM
Test within a range? JC Excel Worksheet Functions 3 May 25th 07 03:41 AM
Test if CELL is in RANGE Vaughan Excel Worksheet Functions 12 November 19th 06 02:48 PM
logical test for each and every cell in range matt Excel Discussion (Misc queries) 4 September 16th 05 06:11 AM
logical test - within a range esslingerdav Excel Worksheet Functions 4 November 17th 04 03:13 PM


All times are GMT +1. The time now is 04:37 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"