ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Selecting Autoshapes (https://www.excelbanter.com/excel-programming/400030-selecting-autoshapes.html)

Pete

Selecting Autoshapes
 
I have a bit of a dilemma, I hope someone in here can help me with.

I have created a spreadsheet that selects and pastes a specific Autoshape to
a specific location based on a formula. Once the Autoshapes are inserted I
want to be able to select them all to group them and move them as needed.

The problem is The autoshapes can be named anything based on the Macro and
formula. How can I select all the shapes in a given area no mater what they
are called?

This is what I have now...

ActiveSheet.Shapes.Range(Array("GroupA", "Three", "Apple", "Three_A")).Select
Selection.ShapeRange.Group.Select

The problem come in when selecting this because "Three, Apple and Three_A".
These names can be anything... "Two, Seven, Orange, Black_A and so on.

The only constant is "GroupA". and GroupA can be in Range(D14:G16), From
there, there will be a GroupB with the same problem and circumstances listed
above. GroupB is located in Range(I14:L16).

Perplexing, I know....
Can anyone help?
--
Pete

excelent

Selecting Autoshapes
 

ActiveSheet.Shapes.SelectAll


"Pete" skrev:

I have a bit of a dilemma, I hope someone in here can help me with.

I have created a spreadsheet that selects and pastes a specific Autoshape to
a specific location based on a formula. Once the Autoshapes are inserted I
want to be able to select them all to group them and move them as needed.

The problem is The autoshapes can be named anything based on the Macro and
formula. How can I select all the shapes in a given area no mater what they
are called?

This is what I have now...

ActiveSheet.Shapes.Range(Array("GroupA", "Three", "Apple", "Three_A")).Select
Selection.ShapeRange.Group.Select

The problem come in when selecting this because "Three, Apple and Three_A".
These names can be anything... "Two, Seven, Orange, Black_A and so on.

The only constant is "GroupA". and GroupA can be in Range(D14:G16), From
there, there will be a GroupB with the same problem and circumstances listed
above. GroupB is located in Range(I14:L16).

Perplexing, I know....
Can anyone help?
--
Pete


excelent

Selecting Autoshapes
 
Or if u only ned some of the shapes
this return all shape names

Sub ShapeNames()

For Each ch In ActiveSheet.Shapes
x = x & vbLf & ch.Name
Next

MsgBox ("Shape Names") & vbLf & x

End Sub



"Pete" skrev:

I have a bit of a dilemma, I hope someone in here can help me with.

I have created a spreadsheet that selects and pastes a specific Autoshape to
a specific location based on a formula. Once the Autoshapes are inserted I
want to be able to select them all to group them and move them as needed.

The problem is The autoshapes can be named anything based on the Macro and
formula. How can I select all the shapes in a given area no mater what they
are called?

This is what I have now...

ActiveSheet.Shapes.Range(Array("GroupA", "Three", "Apple", "Three_A")).Select
Selection.ShapeRange.Group.Select

The problem come in when selecting this because "Three, Apple and Three_A".
These names can be anything... "Two, Seven, Orange, Black_A and so on.

The only constant is "GroupA". and GroupA can be in Range(D14:G16), From
there, there will be a GroupB with the same problem and circumstances listed
above. GroupB is located in Range(I14:L16).

Perplexing, I know....
Can anyone help?
--
Pete


Pete

Selecting Autoshapes
 
Thank you for this, but I do not need to select every Autoshape in the active
worksheet, just a few depending on the application. Again these few autoshape
can be named anything...
--
Pete


"excelent" wrote:


ActiveSheet.Shapes.SelectAll


"Pete" skrev:

I have a bit of a dilemma, I hope someone in here can help me with.

I have created a spreadsheet that selects and pastes a specific Autoshape to
a specific location based on a formula. Once the Autoshapes are inserted I
want to be able to select them all to group them and move them as needed.

The problem is The autoshapes can be named anything based on the Macro and
formula. How can I select all the shapes in a given area no mater what they
are called?

This is what I have now...

ActiveSheet.Shapes.Range(Array("GroupA", "Three", "Apple", "Three_A")).Select
Selection.ShapeRange.Group.Select

The problem come in when selecting this because "Three, Apple and Three_A".
These names can be anything... "Two, Seven, Orange, Black_A and so on.

The only constant is "GroupA". and GroupA can be in Range(D14:G16), From
there, there will be a GroupB with the same problem and circumstances listed
above. GroupB is located in Range(I14:L16).

Perplexing, I know....
Can anyone help?
--
Pete



All times are GMT +1. The time now is 10:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com