Active cell is within a specific range

  • Thread starter Thread starter Todd Huttenstine
  • Start date Start date
T

Todd Huttenstine

I need to check to see if the activecell is within a
particular range. Lets say I want to see if the active
cell is within range "A1:F20". How do I do this?


Thanks
Todd Huttenstine
 
Todd,

Use the Intersect method. For example,

If Application.Intersect(ActiveCell,Range("A1:F20") Is Nothing
Then
' active cell not in range
Else
' active cell in 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