PDA

View Full Version : VBA how do you change the thickess of a line using AddLine



Anthraquinon
07-14-2021, 03:28 PM
This code works fine to change the colour of a line

With ActiveSheet.Shapes.AddLine(pAx, pAy, pBx, pBy).Line
.ForeColor.RGB = RGB(250, 0, 0)
End With

but what syntax do I need to change the thickness of the line.

I have looked but cannot find anywhere that lists all the options for the AddLine command - Any suggestions

AQ

jolivanes
07-14-2021, 09:26 PM
Try
ShapeRange.Line.Weight = 2.5

In your case it would be

With ActiveSheet.Shapes.AddLine(pAx, pAy, pBx, pBy).Line
.ForeColor.RGB = RGB(250, 0, 0)
.Weight = 3.5
End With