Excel - How do I assign a picture to a cell

Asked By Brett1 on 23-Oct-08 03:42 AM
I have 5 pictures (well 5 copies of 1 pic) that I want in B2 C4 C6 D3 & D5 to
begin with. I guess thats a reset button. Next I want to be able to move the
pics one at a time, but can only be put in certain cells. Click move Click
preferred but Click & Drag ok. And last I need a counter eg number of moves.




Peter T replied on 23-Oct-08 07:15 AM
Pictures, indeed all objects (except comments) are not assigned to cells.
They have a position coordinates, L,T,W, & H. Also you can return, though
not set, the TopLeft and BottomRight corner cells as range objects.

To position an object in a particular cell you can do this

dim rCell as Range
dim shp As Shape
Set shp = Activesheet.Shapes("Picture 1")
set rCell = Range("B2")
With shp
.Left = rCell.Left
.Top = rCell.Top
End With

It's easy to implement the above in with multiple objects. You do though
need to have an idea of how (eg names or index) to reference the objects and
corresponding cells.

If you get stuck post back the names of your pictures and related cells.

I have no idea what you mean by counter and moves.

Regards,
Peter T