![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: John G
Posts: 62
|
I want to process items depending on whether they are selected or not. Is there a way to test a cell if is selected or not? If so how would one do that.
Thanks, John |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
|
Here is one simple example
Code:
Sub test()
Dim Rng1 As Range
On Error Resume Next
Set Rng1 = Intersect(Range("A5"), Selection)
If Rng1 Is Nothing Then
MsgBox "Not in selection"
Else
MsgBox "In selection"
End If
End Sub
Jay [ This Message was edited by: Jay Petrulis on 2002-05-16 14:47 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|