Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select single cell 1

Status
Not open for further replies.

faxof

Programmer
Joined
Dec 5, 2001
Messages
272
Location
GB
is there a way to check if a user has selected more than one cell?
at the top of my macro i want something like. . .

If selected.cells > 1 then exit sub

but i'm not to sure of the syntax

any ideas?

faxof
 
Hi
Something like this would do it - you were nearly there!!

Code:
If Selection.Cells.Count > 1 Then
MsgBox "DOH"
'selects the active cell
ActiveCell.Select
' OR maybe the top left cell
'Selection.Range("A1").Select
' or do whatever
End If

Happy Friday
;-) If a man says something and there are no women there to hear him, is he still wrong? [ponder]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top