range of cells

  • Thread starter Thread starter del
  • Start date Start date
D

del

how do you check if a cell falls under a a range of
cells. in other words, check if a cell is within a
particular range.
i tried using strcomp on the addresses but it didn't work.
 
Del,

You can use the Intersect method to determine if a cell is in
another range of cells. E.g.,

Dim Rng As Range
Set Rng = Range("C3")
If Not Application.Intersect(Rng, Range("A1:D4")) Is Nothing Then
Debug.Print "In Range"
Else
Debug.Print "Out of range"
End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top