Halllllo, ik zie dat je de optie "Macro opnemen..." hebt ontdekt.
Dan zal deze code van Bernie DE uitleg zijn voor jou vraag.
SoftAid
Code: Sub ShowRoof()
Dim myC As Range
Set myC = Selection
On Error Resume Next
ActiveSheet.Shapes("Roof").Delete
ActiveSheet.Shapes.AddShape(msoShapeRightTriangle, _
Range("Base").Left, _
Range("Base").Top - Range("Base").Width + Range("Base").Height, _
Range("Base").Width, _
Range("Base").Width).Select
Selection.Name = "Roof"
Selection.ShapeRange.Flip msoFlipHorizontal
Selection.ShapeRange.ScaleHeight _
Range("Rise").Value / Range("Run").Value, _
msoFalse, msoScaleFromBottomRight
myC.Select
End Sub
Finally, copy this code, right-click the sheet tab, select "View Code" and paste the code into the window that appears.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
On Error Resume Next
If Target.Name.Name = "Rise" Or Target.Name.Name = "Run" Then ShowRoof
End Sub
Then enter new values into the cells named Rise or Run, and the trangle will scale as appropriate.
SoftAid