Selecting Autoshapes in Excel 2003

V

Varne

Hello!

If we select an autoshape object in Excel 2003 for instance a rectangle on
sheet1 something like 'Activesheet.Shapes("Rectangle 6").Select will get
written on Visual Basic coding sheets. The problem to me is this code would
not work if that rectangle was replaced with an other one because the new one
will be "Rectangle7".

Can an expert help me on this?

Thanks.

Varne M
 
L

L. Howard Kittle

Hi Varne,

Not an expert but this may help. I entered several rectangles on a sheet
and then named then, Rec1, Rec2, Rec3 etc.

Then I made a list in an unused column of the Rec's. In a adjacent cell I
made a drop down using the list of Rec's as source. Select a Rec in F1 and
run this macro and it should select that Rec.

Sub ShapeSelect()
Dim i As Variant
i = Range("F1").Value
ActiveSheet.Shapes(i).Select
End Sub

HTH
Regards
Howard
 

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