View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Picture pasting where it should but also in alot of cells it shouldn't


I added the destination cell for your paste operation.
I have no way of testing my change, but give it a try...
'---
With .Worksheets(vName)
picSource.Copy
.Paste .Range("B44") '<<<<<<<<<<<<<<
Set picDest = .Pictures(.Pictures.Count)
With .Range("B44")
picDest.Top = .Top + (.Height - picDest.Height) / 2
picDest.Left = .Left + (.Width - picDest.Width) / 2
End With
End With
'---
Also, four variables are not declared.
Add "Option Explicit" as the first line in your module to find out which ones.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)





wrote in message
HELP..........
I have the following Macro:
-snip-
It does what it is supposed to do by copying and pasting all the
figures as required. It them selects the image in "B1" as it is
supposed to and Pastes it into the other workbook in cell "B44" as it
is supposed to, however it is also then pasting the same picture in
the cells beginning with range B46 where all of the figures were just
pasted and of course overwriting the data I just placed in those
cells.
I can't find what I am doing wrong.