How do i check if the current cell is part of a range ?

  • Thread starter Thread starter Luc
  • Start date Start date
L

Luc

Lets say a that i have named some cells TABLE

How do i check if the current cell is in the range with the name TABLE?


Thanxxxx

Luc
 
Luc,

Try some code like the following:

If Not Application.Intersect(ActiveCell, Range("Table")) Is
Nothing Then
Debug.Print "In Table"
Else
Debug.Print "Not in table"
End If


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

If Not Intersect(ActiveCell, Range("TABLE")) Is Nothing Then
MsgBox "In TABLE"
Else
MsgBox "Not in TABLE"
End If
 

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