Hey Guys,
This is my first post on your wonderful forum.
I have been looked through this forum but cant seem to find what I am looking for.
I have a file on my hard-drive with all my product images, I would like to create a Marco to assign the product image next to the product code.
The first cell value is B25 which contains the first product code as a text, I would like to display all the pictures starting from A25 downwards.
I did search the forum for and found this thread
http://www.mrexcel.com/forum/excel-questions/712251-macro-load-picture.html
and tried to modified the code for my purpose but it did not work for me.
Any help would be much appreciated.
Thanks
Ron
This is my first post on your wonderful forum.
I have been looked through this forum but cant seem to find what I am looking for.
I have a file on my hard-drive with all my product images, I would like to create a Marco to assign the product image next to the product code.
The first cell value is B25 which contains the first product code as a text, I would like to display all the pictures starting from A25 downwards.
I did search the forum for and found this thread
http://www.mrexcel.com/forum/excel-questions/712251-macro-load-picture.html
and tried to modified the code for my purpose but it did not work for me.
Option Explicit
Sub Insert_Pic()
Dim filename As String
Dim picpath As String
picpath = "F:\PHOTO\ALL PHOTO\" ' C:\Users\SJR\Desktop\Product Images
Range("a25").Select
filename = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
On Error Resume Next
ActiveSheet.Pictures.Insert(picpath + filename + ".jpg").Select
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Height = 100
Selection.ShapeRange.Width = 134
Selection.Cut
ActiveSheet.Paste
ActiveCell.RowHeight = 100
ActiveCell.ColumnWidth = 25
End Sub
Any help would be much appreciated.
Thanks
Ron