View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\)[_1304_] Rick Rothstein \(MVP - VB\)[_1304_] is offline
external usenet poster
 
Posts: 1
Default check that active cell is within a range

You can use the Intersect method to test that....

If Application.Intersect(ActiveCell, Range("A1:R18")) Is Nothing Then
MsgBox "The active cell is not within the range of A1:R18"
End If

Rick


Trying to modify a macro. The macro is attached to a forms button.

The macro does stuff based on the active cell. When a user clicks the
button
to run the macro I need to pop-up a message box if the active cell isn't
within a named range Table1 (A1:R18) then exit the sub.

Thanks for any assistance you can offer.