Excel Insert Image Into Cell Automatically

Insert Pictures Automatically Based On Cell Value

     
        According to the value entered  in any cell of column A , the image is added automatically into Column E. Images are resized to fit cells.

Names of the pictures with part numbers in column A are same.

Codes that we used in this Excel template :
If Intersect(Target, [A:A]) Is Nothing Then Exit Sub
If Target.Row Mod 20 = 0 Then Exit Sub
On Error GoTo son
ActiveSheet.Pictures.Insert(ThisWorkbook.Path & "\" & Target.Value & ".jpg").Select
Selection.Top = Target.Offset(0, 2).Top
Selection.Left = Target.Offset(0, 4).Left
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Height = Target.Offset(0, 2).Height
Selection.ShapeRange.Width = Target.Offset(0, 4).Width
Target.Offset(1, 0).Select
son:

         We added the pictures and the workbook into the same folder so that each user can run the template on their computer without problems .
 When inserting images into the page, there is no problem that the "image path is not found" (ActiveSheet.Pictures.Insert(ThisWorkbook.Path & "\" & Target.Value & ".jpg").Select) .



⇨ Insert Picture Dynamically In Cell Based On Cell Value & Delete Picture

         The template we created in the tutorial above did not have the ability to delete images.
We have created a new template, in which the image from the folder is found according to the cell value and added to the cell in column E.
If the cell value in column A is deleted or changed, the image for that value is removed from the cell in column E.

5 comments:

  1. Excellent!!!
    Simple and effective. It was very useful.

    ReplyDelete
  2. Hi, unable to download the file. Someone Could help on this please?

    ReplyDelete
  3. Can you send me the zip file directly to my email address because I have a problem to download it from the given drive link

    ReplyDelete