how to know the cell address in point units.

  • Thread starter Thread starter =?iso-2022-jp?B?RVhDRUwbJEIhIRsoQk5FV1M=?=
  • Start date Start date
?

=?iso-2022-jp?B?RVhDRUwbJEIhIRsoQk5FV1M=?=

hi,
i am using ,expression.AddShape(Type, Left, Top, Width, Height)
Left, Top are point units,how to make the shape exactly in the place of an
aimed cell.
or to say, how to know the cell address in point units.
thank you.
 
No need to know the exact coordinates:

With Range("J1")
ActiveSheet.Shapes.AddShape _
Type:=msoShapeSmileyFace, _
Left:=.Left, _
Top:=.Top, _
Width:=.Width, _
Height:=.Height
End With
 
Hi John,
Interesting, even though the shape is anchored to the four
borders, you can move and distort the image manually, but
the image still remains anchored to the four original points
(cell's top, left, width, height) and will distort according to
their movement.
 
A shape's default .Placement property value is xlMoveAndSize. Change it
to xlFreeFloating if desired:

With Range("J10")
With ActiveSheet.Shapes.AddShape( _
Type:=msoShapeSmileyFace, _
Top:=.Top, Left:=.Left, _
Width:=.Width, _
Height:=.Height)
.Placement = xlFreeFloating
End With
End With
 
Back
Top