PDA

View Full Version : Solved: Copy a Picture



chem101
10-18-2010, 10:41 AM
Hello Everyone,

I'm having trouble copy a picture from one worksheet to another. I'm able to import the .jpeg using code without a a problem - I just can't seem to copy it to another worksheet based on two conditions. Here's what I've been trying with no positive results:

Sub CopyWHMSTRPic()
Dim ws As Worksheet
Set ws = ActiveSheet
If Range("InputboxStyle").Value = "ABC" And Range("InputJoint").Value = "Textured" Then
ws.Range("i33:aa43").CopyPicture
Worksheet("WH Master").Range("aa24").Activate
Worksheeets("WH Master").Paste
End If
End Sub

Can you help me?

Any help you can provide will be greatly appreciated.

Thank you!

jolivanes
10-18-2010, 06:44 PM
instead of

ws.Range("i33:aa43").CopyPicture

have you tried


ws.Shapes("Picture 1").copy <----use actual name of the picture

HTH
John

chem101
10-19-2010, 05:19 AM
I found that this works. Please let me know if you think there is a better way for me to proceed. I'm sorry I didn't post this result sooner. We had problems with our server.

Sub CopyWHMSTRPic()
Dim ws As Worksheet
Set ws = ActiveSheet
If Range("InputboxStyle").Value = "RSC" And Range("InputJoint").Value = "Stitched-Flap I/S" Then

ws.Range("i33:aa43").CopyPicture
Worksheets("WH Master").Activate
Worksheets("WH Master").Range("aa24").Activate
Worksheets("WH Master").Paste
End If
Application.ScreenUpdating = False
wksNewOrder.Activate
Range("A1").Select
Range("OrderNumber").Select
Application.ScreenUpdating = True
End Sub

Thank you all for your assistance!!