Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Mike,
If you are running this code from a button click, make sure its ..TakeFocusOnClick=False, otherwise you will always return a Selection.Count=1, i.e. the button. NickHK "Mike" wrote in message ... Seems easy enough, but does not seem to be working. I have this: Selection.Count If Selection.Count 1 Then GoTo MultipleObjects Else End If Does not seem to understand Selection.Count "Tom Ogilvy" wrote: Your trying to see if multiple objects are selected Demo'd from the immediate window: ? selection.count 3 ? selection(1).Name Rectangle 6 ? selection(2).Name Oval 7 so use if selection.count 1 then ' multiple objects selected -- regards, Tom Ogilvy "Mike" wrote: If the user has multiple objects selected, I want to do something. If you have one object selected, and use Selection.Name it gives the name of the object. If you have multiple objects selected, it gives an error. So I thought I could do this: If Selection.Name Is Error Then (do whatever) But it doesn't work. Any ideas? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2007: Selecting multiple objects by drawing a selection box | Excel Discussion (Misc queries) | |||
Selecting objects for deletion in 2007 | Excel Discussion (Misc queries) | |||
selecting multiple objects with macro | Excel Discussion (Misc queries) | |||
Stopping mouse selecting chart objects | Charts and Charting in Excel | |||
Selecting drawing objects or shapes in a macro | Excel Programming |