Selecting All AutoShapes on a Worksheet

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
 
A

Alan

Alan said:
I am trying to write a small sub that will select all the shapes on a
worksheet.

Never mind!

ActiveSheet.Shapes.SelectAll


Talk about trying to over complicate things!

Thanks,

Alan.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top