K. Georgiadis
03-15-2005, 08:10 PM
In the following simple macro, what instruction needs to be added so that the rectangle is drawn with its top left corner at the intersect of row 6 and column D (or thereabouts)?
Sub MakeNewRectangle()
Dim mySheet As Worksheet
Dim myShape As Shape
Dim myCell As Range
Set mySheet = ActiveSheet
Set myShape = mySheet.Shapes.AddShape(msoShapeRectangle, 72, 36, 72, 36)
myShape.Fill.ForeColor.SchemeColor = 10
End Sub
I answered my own question:) :
Sub MakeNewRectangle()
Dim mySheet As Worksheet
Dim myShape As Shape
Dim myCell As Range
Set mySheet = ActiveSheet
Set myShape = mySheet.Shapes.AddShape(msoShapeRectangle, 110, 110, 72, 36)
myShape.Fill.ForeColor.SchemeColor = 10
End Sub
Sub MakeNewRectangle()
Dim mySheet As Worksheet
Dim myShape As Shape
Dim myCell As Range
Set mySheet = ActiveSheet
Set myShape = mySheet.Shapes.AddShape(msoShapeRectangle, 72, 36, 72, 36)
myShape.Fill.ForeColor.SchemeColor = 10
End Sub
I answered my own question:) :
Sub MakeNewRectangle()
Dim mySheet As Worksheet
Dim myShape As Shape
Dim myCell As Range
Set mySheet = ActiveSheet
Set myShape = mySheet.Shapes.AddShape(msoShapeRectangle, 110, 110, 72, 36)
myShape.Fill.ForeColor.SchemeColor = 10
End Sub