Hi
I have posted this before but had no joy, so I am reposting hoping to resolve.
I have the following code that looks up an image based on the text in the cells in column A, this look-up the image and places it in column L. The problem is when I email the file the images disappear. Is there any way to ensure that the images are kept in the sheet?
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myPict As Picture
Dim PictureLoc As String
Dim lr As Long, r As Long
lr = Cells(Rows.Count, "A").End(xlUp).Row
ActiveSheet.Pictures.Delete
For r = 2 To lr
PictureLoc = "C\photography" & Range("A" & r).Value & ".jpg"
With Range("l" & r)
Set myPict = ActiveSheet.Pictures.AddPicture(PictureLoc)
.RowHeight = 144
myPict.Top = .Top
myPict.Left = .Left
myPict.Width = 110
myPict.Height = 140
myPict.Placement = xlMoveAndSize
End With
Next r
End Sub
Thanks in advance.
I have posted this before but had no joy, so I am reposting hoping to resolve.
I have the following code that looks up an image based on the text in the cells in column A, this look-up the image and places it in column L. The problem is when I email the file the images disappear. Is there any way to ensure that the images are kept in the sheet?
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myPict As Picture
Dim PictureLoc As String
Dim lr As Long, r As Long
lr = Cells(Rows.Count, "A").End(xlUp).Row
ActiveSheet.Pictures.Delete
For r = 2 To lr
PictureLoc = "C\photography" & Range("A" & r).Value & ".jpg"
With Range("l" & r)
Set myPict = ActiveSheet.Pictures.AddPicture(PictureLoc)
.RowHeight = 144
myPict.Top = .Top
myPict.Left = .Left
myPict.Width = 110
myPict.Height = 140
myPict.Placement = xlMoveAndSize
End With
Next r
End Sub
Thanks in advance.