Hi
To draw a right triangle you can also use the RightTriangle shape.
For ex.:
Sub DrawRightTriangle(sName As String, dLeft As Double, dTop As Double, dWidth As Double, dHeight As Double)
Dim shp As Shape
Set shp = ActiveSheet.Shapes.AddShape(msoShapeRightTriangle, dLeft, dTop, dWidth, dHeight)
shp.Name = sName
End Sub
A test to create your 120*20 triangle
DrawRightTriangle "RightTriangle01", 50, 100, 20,120
You can use a loop that calls DrawRightTriangle to create your 48 triangles.
You know their name so they will be easy to manipulate.
To fill the shape with a color you can add to the procedure, for ex.:
shp.Fill.ForeColor.RGB = RGB(255, 0, 0)
Bookmarks