I am trying to add lines to sheet1 using VBA. I have not been able to figure out how to change the color and thickness of the lines. Can someone help?
I want to be able to add a line using VBA, give the line a Name so that I can refer to it in code and move it around to the exact position that I want. Ideally, I want to create a line with an arrow facing to the right. After creating the line, I want to adjust the top, left, width, name, color, line weight, etc. I cannot seem to get the syntax correct for adjusting all of these properties.
Here is the code that I am using...
<pre>
Dim MyName as string
Set myDocument = Worksheets(1)
Counter = Counter + 1
With myDocument.Shapes.AddLine(10, 50, 100, 50)
MyName = .Name
.Height = 0
End With
</pre>
Thanks for any help,
David
I want to be able to add a line using VBA, give the line a Name so that I can refer to it in code and move it around to the exact position that I want. Ideally, I want to create a line with an arrow facing to the right. After creating the line, I want to adjust the top, left, width, name, color, line weight, etc. I cannot seem to get the syntax correct for adjusting all of these properties.
Here is the code that I am using...
<pre>
Dim MyName as string
Set myDocument = Worksheets(1)
Counter = Counter + 1
With myDocument.Shapes.AddLine(10, 50, 100, 50)
MyName = .Name
.Height = 0
End With
</pre>
Thanks for any help,
David