Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clearly seeing active cell in a range dsa Excel Discussion (Misc queries) 2 March 24th 08 03:22 PM
Is Active Cell in a Range? Aaron Excel Programming 3 January 17th 08 09:11 PM
Active cell as range Patrick Simonds Excel Programming 4 May 29th 06 08:21 PM
Spell Check range and move to active cells Jay[_21_] Excel Programming 3 May 16th 06 11:04 PM
check active cell column KimR.Hammel[_2_] Excel Programming 2 August 10th 05 09:35 PM


All times are GMT +1. The time now is 09:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"