kelly mort
Well-known Member
- Joined
- Apr 10, 2017
- Messages
- 2,169
- Office Version
- 2016
- Platform
- Windows
Code:
Sub Insert_Multiple_Images()
Set Image_Names = Range("B3:B8")
Image_Location = ThisWorkbook.Path & "\Images”
Image_Format = ".jpg”
Set Cell_Reference = Range("C3:C8")
For i = 1 To Image_Names.Rows.Count
For j = 1 To Image_Names.Columns.Count
Set Image = ActiveSheet.Pictures.Insert(Image_Location + "\" + Image_Names.Cells(i, j) + Image_Format)
Image.Top = Cell_Reference.Cells(i, j).Top
Image.Left = Cell_Reference.Cells(i, j).Left
Image.ShapeRange.Height = 45
Image.ShapeRange.Width = 20
Next j
Next i
End Sub
On this line:
Code:
Image_Format = ".jpg”
I want it to be able to accept all image formats or extensions.
Then on these lines:
Code:
Image.Top = Cell_Reference.Cells(i, j).Top
Image.Left = Cell_Reference.Cells(i, j).Left
I want to get the images centered in the cells.
My row height is 30 at the moment.
Thanks in advance