Draw line dynamiclly in Microsoft Excel

[ 2006-08-21 07:07:40 | Author: liuhuan ]
Font Size: Large | Medium | Small
Coz seems there's no line object in Microsoft Excel . Here we use shape and addline method.
Quote
Sub drawline()
Dim X1, X2, Y1, Y2 As Single
Dim theline As Shape
X1 = Cells(2, 1).Value
X2 = Cells(2, 3).Value
Y1 = Cells(2, 2).Value
Y2 = Cells(2, 4).Value
Set theline = Sheet1.Shapes.AddLine(X1, Y1, X2, Y2)
End Sub
Click Here To Download
Comments Feed Comments Feed: http://www.liuhuan.com/blog/feed.asp?q=comment&id=594

There is no comment on this article.

You can't post comment on this article.