Thread: cell range
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default cell range

Use intersect

Worksheets("Sheet1").Activate
Set isect = Application.Intersect(Range("rg1"), Range("rg2"))
If isect Is Nothing Then
MsgBox "Ranges do not intersect"
Else
isect.Select
End If

"ranswert" wrote:

I need to write a procedure that will run only when a selected cell is within
a range of cells. How do I identify if it is within a range?