Frage zur Pfeilerstellung
07.01.2022 12:40:05
Franz
Die Daten für Länge und Höhe sowie Farbe steht in der Tabelle von AP30 bis AS50.
was stimmt am folgenden VBA nicht? Es kommt der Fehler "Next ohne For" :
Sub pfeile()
Dim i As Long
For i = 30 To 50
Ax = Cells(i, 42).Value
Ay = Cells(i, 43).Value
Bx = Cells(i, 42).Value
By = Cells(i, 44).Value
ActiveSheet.Shapes.AddConnector(msoConnectorStraight, Ax, Ay, Bx, By). Select
With Selection.ShapeRange.Line
.Visible = msoTrue
.Weight = 3
.Visible = msoTrue
.ForeColor.ObjectThemeColor = farbe
.ForeColor.TintAndShade = 0
.ForeColor.Brightness = -0.25
.Transparency = 0
Selection.ShapeRange.Line.EndArrowheadStyle = msoArrowheadTriangle
Next i
End Sub