Format merged cells to receive JPEG

L

Larry

I have a worksheet with Cells D13:J39 merged. I have a macro which will copy
a photo to the target cell D13. However, when the jpg is pasted, it is the
original photo size and does not fit within the merged cells and extends way
beyond the designated boundries of the merged cells. Can you help with the
syntax required to ensure that any photo selected will fit within the
designated boundries of the merged cells? Bernie was kind enough to help me
with the syntax to copy and paste the jpg to begin with.

myName = "D:\Winners Picture\" & _
Target.Value & ".jpg"
MsgBox myName, vbMsgBoxLeft, "Print Winner Poster"
Application.EnableEvents = False
With Worksheets("Winner Poster")
.Range("A1").Value = Target.Value
.Select
.Shapes("Inserted").Delete
.Range("D13").Select
.Pictures.Insert(myName).Select
Selection.Name = "Inserted"
.Range("D13").Select
End With
Worksheets("Winner Photo Log").Select

I would appreciate any advice you may have to offer.

Regards,
Larry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top