This is for pure learning reasons, no project.
All of the following code is from the help file. I am curious about certain objects and properties that I have not used to become familiar.
In this case wanted to see what .List was about, which took me to Shapes.
I could not get enough information about .List, so I went onto Shapes.
My interest is purely about worksheet shapes, not charts.
Examples 1,2,3, and 4 are where my questions lie.
Examples 5 and 6 were successful.
I have two shapes on my worksheet, drawn from the tools on the Drawing Toolbar.
Ex.2 refers to Shapes(1). I looked for properties on the sheet of the shapes to see how these were referenced. I could not find any where that referes to the properties of these created shapes.
So when it is instructing the shape to be flipped, how is it referencing a particuluar shape.
Ex.3 & 4 refer to the shape by name "Rectangle 1", same basic questions.
How is this shape referenced by this name?
[vba]
Sub test()
'ex.1
Worksheets(1).Shapes(2).ControlFormat.List = _
Array("cogs", "widgets", "sprockets", "gizmos")
Application.AddCustomList Array("cogs", "sprockets", _
"widgets", "gizmos")
'ex.2
Set myDocument = Worksheets(1)
myDocument.Shapes(1).Flip msoFlipHorizontal
myDocument.Shapes("Rectangle 1").Flip msoFlipHorizontal
'ex.3
Worksheets(1).Shapes(1).Flip msoFlipHorizontal
'ex.4
Worksheets(1).Shapes("Rectangle 1").Flip msoFlipHorizontal
'ex.5
Worksheets(1).Shapes(1).Fill.ForeColor.RGB = RGB(255, 255, 0)
'ex.6
Set myDocument = Worksheets(1)
With myDocument.Shapes.AddShape(msoShapeRightTriangle, _
10, 10, 50, 50).Duplicate
.Fill.ForeColor.RGB = RGB(255, 0, 0)
.Flip msoFlipVertical
End With
End Sub
[/vba]
thanks.....