reference image from another cell if statement

Charlie987

New Member
Joined
Jul 25, 2020
Messages
25
Office Version
  1. 365
Platform
  1. Windows
Hi,
I am trying to create an if statement that tests if a name is present and if so, inserts an image into a cell in that row. the image can be in a cell on that sheet (if that is the easiest way to do it).
so far i have:
Dim rng As Range
Set rng = ActiveSheet.Range("A3:A300")
For Each cell In rng.Cells
If InStr(1, cell, "John") > 0 And InStr(1, cell.Offset(0, 1), "Smith") Then
cell.Offset(0, 4).Value = "????????"
End If
Next
I am just not sure how to reference the image to use it.
Thanks
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
If you have the image for John Smith in a specific cell, for example M1.

VBA Code:
range("M1").copy  cell.Offset(0, 4)
 
Upvote 0
Thank you! I am coming up against the problem of getting the image into the cell to reference. I can get it inserted into the sheet, but cant find much information about how to get it into the cell. (Most of the tutorials talk about setting the properties to move with the cell but it still doesn't reference the image).
If anyone had any thoughts on how to insert the image into the cell for referencing or other ways to reference an image it would be great.
Thanks again!!
 
Upvote 0
Leila has a great example on working with images, it would give an idea of how to place images based on a cell value

 
Upvote 0

Forum statistics

Threads
1,214,527
Messages
6,120,058
Members
448,940
Latest member
mdusw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top