Hello,
I Search on the forum and found vba code which similar to my need. I try to edit them.
Basically, i want to insert pictures from folder to each column ( B2, C2, D2... an so on, until the last picture).
the code below, is working, but instead to insert to each column, it just insert to each row ( B2, B3, B4 etc).
can anyone help?
also i want all picture have 1 inch size ( height and weight ).
thanks.
Sub qiyusipicture ()
InsertAllPix Range("B2"), _
"D:\New folder", _
"*.jpg"
End Sub
Sub InsertAllPix(r As Range, ByVal sDir As String, sFilt As String)
Dim sPic As String
Dim iCol As Long
If Right(sDir, 1) <> "\" Then sDir = sDir & "\"
sPic = Dir(sDir & sFilt)
Do While Len(sPic)
icol = icol + 1
With ActiveSheet.Pictures.Insert(sDir & sPic)
.ShapeRange.LockAspectRatio = msoFalse
.Height = r(icol, 1).Height
.Width = r(icol, 1).Width
.Top = r(icol, 1).Top
.Left = r(icol, 1).Left
.Placement = xlMoveAndSize
End With
sPic = Dir
Loop
End Sub
Bookmarks