A
Alan
Hi All,
I am trying to write a small sub that will select all the shapes on a
worksheet.
The code I have below *seems* to create the array, but how do I then
use that array to actually select the shapes?
The four lines I hav commented out are the ones I am struggling with -
those are my attempts, but they all error out.
I am using Excel 2000 under Win 2000 Pro with all updates and service
packs installed.
Thanks,
Alan.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Sub SelectAllShapes()
Dim Counter As Integer
Dim MyShape As Shape
Dim CurrentShape As Shape
Dim ShapesCollection() As Variant
Counter = 1
For Each MyShape In ActiveSheet.Shapes
Set CurrentShape = ActiveSheet.Shapes(Counter)
ReDim Preserve ShapesCollection(Counter)
Set ShapesCollection(Counter - 1) = CurrentShape
Counter = Counter + 1
Next MyShape
'ActiveSheet.ShapesCollection.Select
'ActiveSheet.Shapes.Range(ShapesCollection).Select
'ActiveSheet.Shapes.Array(ShapesCollection).Select
'ActiveSheet.Shapes.Range(Array(ShapesCollection)).Select
End Sub
I am trying to write a small sub that will select all the shapes on a
worksheet.
The code I have below *seems* to create the array, but how do I then
use that array to actually select the shapes?
The four lines I hav commented out are the ones I am struggling with -
those are my attempts, but they all error out.
I am using Excel 2000 under Win 2000 Pro with all updates and service
packs installed.
Thanks,
Alan.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Sub SelectAllShapes()
Dim Counter As Integer
Dim MyShape As Shape
Dim CurrentShape As Shape
Dim ShapesCollection() As Variant
Counter = 1
For Each MyShape In ActiveSheet.Shapes
Set CurrentShape = ActiveSheet.Shapes(Counter)
ReDim Preserve ShapesCollection(Counter)
Set ShapesCollection(Counter - 1) = CurrentShape
Counter = Counter + 1
Next MyShape
'ActiveSheet.ShapesCollection.Select
'ActiveSheet.Shapes.Range(ShapesCollection).Select
'ActiveSheet.Shapes.Array(ShapesCollection).Select
'ActiveSheet.Shapes.Range(Array(ShapesCollection)).Select
End Sub