ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how to addshapes in a position decided by offsetting a cell , (https://www.excelbanter.com/excel-programming/368786-how-addshapes-position-decided-offsetting-cell.html)

EXCEL NEWS

how to addshapes in a position decided by offsetting a cell ,
 
hi,

i wonder how to addshapes in a position decided by offsetting a cell ,

instead of points ,like this ActiveSheet.Shapes.AddShape msoShapeRectangle,
179.25, 194.25, 14.25, 9

thanks,



Tom Ogilvy

how to addshapes in a position decided by offsetting a cell ,
 
for i = 1 to 10 step 3
for j = 1 to 4 step 2
with range("B9").Offset(i,j)
Activesheet.Shapes.AddShape msoShapeRectangle, _
.Left, .Top, .Width, .Height
End With
Next j
Next i

--
Regards,
Tom Ogilvy


"EXCEL NEWS" wrote in message
...
hi,

i wonder how to addshapes in a position decided by offsetting a cell ,

instead of points ,like this ActiveSheet.Shapes.AddShape
msoShapeRectangle,
179.25, 194.25, 14.25, 9

thanks,





EXCEL NEWS

how to addshapes in a position decided by offsetting a cell ,
 
Thanks a lot.For your sub,

the sub is all ok,but i just want to addshape to the cell,

so i have to calculate the point-style position,


thanks
best regards

"Tom Ogilvy" wrote in message
...
for i = 1 to 10 step 3
for j = 1 to 4 step 2
with range("B9").Offset(i,j)
Activesheet.Shapes.AddShape msoShapeRectangle, _
.Left, .Top, .Width, .Height
End With
Next j
Next i

--
Regards,
Tom Ogilvy


"EXCEL NEWS" wrote in message
...
hi,

i wonder how to addshapes in a position decided by offsetting a cell ,

instead of points ,like this ActiveSheet.Shapes.AddShape
msoShapeRectangle,
179.25, 194.25, 14.25, 9

thanks,






Dave Peterson

how to addshapes in a position decided by offsetting a cell ,
 
Did you try this?

Didn't it put each rectangle over different cells?

EXCEL NEWS wrote:

Thanks a lot.For your sub,

the sub is all ok,but i just want to addshape to the cell,

so i have to calculate the point-style position,

thanks
best regards

"Tom Ogilvy" wrote in message
...
for i = 1 to 10 step 3
for j = 1 to 4 step 2
with range("B9").Offset(i,j)
Activesheet.Shapes.AddShape msoShapeRectangle, _
.Left, .Top, .Width, .Height
End With
Next j
Next i

--
Regards,
Tom Ogilvy


"EXCEL NEWS" wrote in message
...
hi,

i wonder how to addshapes in a position decided by offsetting a cell ,

instead of points ,like this ActiveSheet.Shapes.AddShape
msoShapeRectangle,
179.25, 194.25, 14.25, 9

thanks,





--

Dave Peterson


All times are GMT +1. The time now is 07:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com