View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy[_2_] Patrick Molloy[_2_] is offline
external usenet poster
 
Posts: 1,298
Default Programming "Shape" objects

Sub shownames()
Dim sh As Shape
For Each sh In ActiveSheet.Shapes
Debug.Print sh.Name
Next
Set sh = ActiveSheet.Shapes("Oval 6")
With sh
.AutoShapeType = msoShape32pointStar
End With
End Sub

in my demo, I dropped several shapes onto a sheet, the first loop gave me
the default names, one of which I typed into the SET Sh statement, and then I
chnaged thetype of shape from an oval to a start

"Robert Crandal" wrote:

My spreadsheet contains multiple "shape" objects. I would like to be able
to
change the properties of my various shapes when certain events happen, but
the problem is I don't know the names of my shapes. How are shape objects
referenced in Visual Basic code??

Do I use the following reference format :

Worksheets(1).Shapes(1)..... etc. etc....

If I have 10 shapes on my spreadsheet does, how does Visual Basic determine
which shape gets assigned which numer or name??

Thank you!

Robert

.