View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
keepITcool keepITcool is offline
external usenet poster
 
Posts: 2,253
Default Selecting most of very many programmatically


what you can also do is expanding
a selection by setting the replace argument to false..

Sub SubSet()
Dim shp As Shape
Dim sel As DrawingObjects

Application.ScreenUpdating = False
ActiveCell.Select
For Each shp In ActiveSheet.Shapes
If shp.AutoShapeType = msoShapeOval Then
shp.Select False
End If
Next
Set sel = Selection
Application.ScreenUpdating = True

End Sub



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Tom Ogilvy wrote :

Sub SelectSubset()
Dim v() As Variant
v = Array("Rectangle 2", "Oval 5")
ActiveSheet.Shapes.Range(v).Select
End Sub

worked for me. The declaration

Dim v() as Variant

was important.

this also worked:

Sub SelectSubset()
Dim v() As Variant
ReDim v(0 To 1)
v(0) = "Rectangle 2"
v(1) = "Oval 5"
ActiveSheet.Shapes.Range(v).Select
End Sub