Hello All,
I want to copy/paste 2 pictures from other sheets in my workbook to the active sheet that I run the macro in.
How do I do this?
Currently it only works in 'sheet 3' but I want it to work for any worksheet that I execute the macro in.
Any help would be appreciatedSub Logos() ' ' Macro5 Macro ' ' Sheets("Sheet1").Select ActiveSheet.Shapes.Range(Array("Picture 1")).Select Selection.Copy Sheets("Sheet3").Select Range("D2").Select ActiveSheet.Paste Sheets("Sheet2").Select ActiveSheet.Shapes.Range(Array("Picture 1")).Select Selection.Copy Sheets("Sheet3").Select Range("L2").Select ActiveSheet.Paste End Sub I found this code through searching but not sure how to implement it... Sub test() Dim wsF As Worksheet Dim wsU As Worksheet Set wsU = ThisWorkbook.Worksheets("Update") Set wsF = ThisWorkbook.Worksheets("Sheet2") wsF.UsedRange.Offset(1).Copy Destination:=wsU.Range("C5") End Sub
Last edited by pike; 11-15-2011 at 03:18 AM. Reason: add code tags for newbie pm rules
Sub steffen Dim ws as worksheet Set ws = ActiveSheet With sheets(1) .Shapes.Range(Array("Picture 1")).Copy End with ws.Paste With sheets(2) .Shapes.Range(Array("Picture 1")).Copy End with ws.Paste End sub
Thanks man,
Will give this a try. Im a bit confused how I set the range in the destination sheet?
Range("L2").Select
ws.Paste
Like this
ws.Range("L2").Paste
Many thanks Steffen
It does'nt like the code. I tried to modify it but it select "B19" in active sheet and doesnt paste?
Sub Logos()
'
' Macro5 Macro
'
'
Dim ws As Worksheet
Set ws = ActiveSheet
With Sheets(1)
.Shapes.Range(Array("Logo1")).Select
Selection.Copy
End With
ws.Range("D2").Paste
End Sub
Why are you selecting, have you tried the code i gave you as it is?
Dim ws as worksheet Set ws = ActiveSheet With sheets(1) .Shapes.Range(Array("Picture 1")).Copy End with ws.Range("L2").Paste With sheets(2) .Shapes.Range(Array("Picture 1")).Copy End with ws.Range("D2").Paste End sub
I tried this also as it works for text..
Sheets("Sheet1").Shapes.Range(Array("Logo2")).Copy Destination:=ActiveSheet.Range("D2").Paste
Can you upload the workbook? Or a workbook with similar data and i'll i have a look!
It doesnt like this line..
.Shapes.Range(Array("Picture 1")).Copy
Error 438: Object doesnt support this property or method
One moment
Its Logos macro
Last edited by rtcwlomax; 11-22-2011 at 02:56 PM.
Please upload to this site, there is an upload button when you post!
Ok hopefully it attached.
Thanks for your help
This works!
Just change the destiantion range to fitSub Steffen() Dim ws As Worksheet Set ws = ActiveSheet With Sheets(1) .Shapes("Picture 1").Copy End With ws.Range("L2").PasteSpecial With Sheets(1) .Shapes("Logo2").Copy End With ws.Range("L8").PasteSpecial End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks