Hi, All,
I have a program to make a function to paste picture, the is work but the problem that I need embed all the picture into excel independently.
can anyone can help to make some correction for me?
my Macro program here:
Dim I As integer
Dim FilPath As String
Dim Rng As Range
With Sheet1
For I = 2 To . Range("B65536") .End(xlup).Row
FilPath = "R:\04 Seasonal\"& .Cells(I,2).text & ".jpg"
If Dir(FilPath) <> "" Then
.Pictures.Insert(FilPath).Select
Set Rng = .Cells(I, 1)
With Selection
.Top = Rng.Top + 1
.Left = Rng.Left + 1
.Width = Rng.Width - 1
.Height = Rng.Height - 1
End With
Else
S = S & Chr(10) & .Cells(I,2).Text
End If
Next
.Cells(2, 2).Select
End With
If S <> "" Then
MsgBox S & Chr(10) & "No Picture"
End If
End Sub
Bookmarks