Single Folder not merge
Single Folder not merge
' Set the parent folder path where your images are located
parentFolder = "D:\Office\Pictures Footwears AlNasser\" ' Update this path
imgFolder = parentFolder & "4DC_PIC\" ' The folder where the images are
' Find the column number for the "Picture" column by searching for the header
pictureColumn = 0
For Each cell In ws.Rows(1).Cells ' Search in the first row
If cell.Value = "Picture" Then
pictureColumn = cell.Column
Exit For
End If
Next cell
' If a matching image is found, insert and embed the image into the
"Picture" column
If imgPath <> "" Then
' Insert the image as an embedded object using Shapes.AddPicture
Set img = ws.Shapes.AddPicture( _
Filename:=imgPath, _
LinkToFile:=msoFalse, _
SaveWithDocument:=msoCTrue, _
Left:=cell.Offset(0, pictureColumn - 1).Left, _
Top:=cell.Offset(0, pictureColumn - 1).Top, _
Width:=-1, Height:=-1)