A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Here is some code to draw a simple rectangle. The 4 points are defined relative to the cell boundries:
Sub PlaceRectangle()
' 0,0 is upper left corner of A1
' 0,1 is upper left corner of B1
' 1,0 is upper left corner of A2
' 1,1 is upper left corner of B2
With Range("A1")
le = .Left
tp = .Top
wd = .Offset(0, 1).Left - le
he = .Offset(1, 0).Top - tp
End With
With ActiveSheet
.Shapes.AddShape(msoShapeRectangle, le, tp, wd, he).Select
End With
End Sub
gsnu201101