views:

148

answers:

1

1) hi i just wanted to know why excel-2007 record macro does not write anything for example when i do the following:

i insert a rectangle on the sheet and change its backcolor...

(on the other hand, if i do the same thing in excel-2003 i get some code)

2) also is it possible to using vb to ask excel to put the rectangle on specified position for example my current active cell is A10:C10

i want my rectangle's upper left corner to be on that location, i.e. A10:C10

thanks a lot!

+1  A: 

Not sure about your first question, but as for your second, use the cell Left and Top properties as the Left and Top for the rectangle. This is VBA:

Dim sht As Worksheet
Set sht = ActiveSheet

Dim rng As Range
Set rng = shtCells(3, 4)
sht.Shapes.AddShape msoShapeRectangle, rng.Left, rng.Top, 30, 40
Joel Goodwin