Thread: Dave Peterson
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Dave Peterson

See if this works:

Sub testme1()
Dim FWks As Worksheet
Dim TWks As Worksheet
Dim myPict As Object

Set FWks = Worksheets("billeder")
Set TWks = Worksheets("print")

TWks.Select
For Each myPict In FWks.Pictures
If TypeName(myPict) = "Picture" Then
myPict.Copy
TWks.Range(myPict.TopLeftCell.Address(0, 0)).Select
TWks.Paste
End If
Next myPict


End Sub

--
Regards,
Tom Ogilvy


"Alvin Hansen" wrote in message
...
Hi
I try to use the script you help me with to copy pictures from one sheet

to
another
this one:
Sub testme()
Dim FWks As Worksheet
Dim TWks As Worksheet
Dim myPict As Picture

Set FWks = Worksheets("billeder")
Set TWks = Worksheets("print")

For Each myPict In FWks.Pictures
myPict.copy
TWks.Range(myPict.TopLeftCell.Address(0, 0)).PasteSpecial _
Paste:=xlPasteAll
Next myPict

End Sub
But get an error by excel there write
"excel canoot paste the data"

CAn you or someone else help me?

regards

Alvin