Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
check that active cell is within a range
Hello All
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
check that active cell is within a range
Thanks Rick, works great.
"Rick Rothstein (MVP - VB)" wrote: 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Clearly seeing active cell in a range | Excel Discussion (Misc queries) | |||
Is Active Cell in a Range? | Excel Programming | |||
Active cell as range | Excel Programming | |||
Spell Check range and move to active cells | Excel Programming | |||
check active cell column | Excel Programming |