View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Image pasting to incorrect cells or bad location within cells

Well, you can't just make up properties for Range objects...

And pictures will always exist on the Drawing Layer above the cells
(i.e., cells can only hold values or formulae).

This will center the picture over the cell:

With .Range("F29")
picDest.Top = .Top + (.Height - picDest.Height) / 2
picDest.Left = .Left + (.Width - picDest.Width) / 2
End With

That presumes that F29 is larger than your pasted pic, of course.


In article . com,
wrote:

Thanks that works, but of course you knew it would.

Is there any way to get it to align to the middle of the cell. The
image is about half the width of the column and although your code
places the image in the cell it of course aligns to the left. I tried
changing the .Left to .Middle and / or .Center and they didn't work.
Is there a way to bump the image down at all? The destination cell
happens to have a white cell background with a black cell border. It
would be tremendous if I could get the image to place inside of the
cell and inside of the border instead of on top of the border.

Thanks for your asssitance.