May 23 2017 12:14 AM
I would like to show some images in my Excel spreadsheet only when certain conditions are valid.
For example: Only show the image when A1>10 or B4<5.
How should I do this?
Gosse
May 23 2017 07:37 AM
May 23 2017 08:01 PM
SolutionHi Gosse,
This https://excelribbon.tips.net/T010450_Displaying_Images_based_on_a_Result.html tip could help
May 24 2017 03:20 AM - edited May 24 2017 03:21 AM
1. In C1 cell use =IF(AND(A1>10,B1<5),CHOOSE(RANDBETWEEN(1,3),"mb_1","mb_2","mb_3"),"x") this formula to generate "mb_1", "mb_2" and "mb_3" three images name based on your condition.
2. Select C1 cell and click on Formula | Define Name and type: "ShowPhoto" as name and =INDIRECT(Sheet1!$C$1) as refers to.
3. Insert 3 marble ball images into E11, F11, G11 and H11. And name these cells as "mb_1", "mb_2", "mb_3" and "x" and refers to as below:
For E11, =Sheet1!$E$11, For F11, =Sheet1!$F$11 For G11, =Sheet1!$G$11 For H11, =Sheet1!$H$11
4. Select E11 cell and Click on Home | Copy | Copy as picture. While a dialog box appear, Click on "Ok" to copy it. Now press Ctrl+V on that sheet to paste the image.
5. Select the pasted image and enter =ShowPhoto in the formula bar to link it.
6. Now change the value A1 or B1 to change the condition of C1 which will generate a image name and pasted image will change the image like below image:
Here I have attached the whole working file. So that you can try it.
For more reference, an article on below link will helpful:
http://afaysal.blogspot.com/2017/05/how-to-display-image-in-worksheet-based.html
Hope this will help you.
May 24 2017 05:39 AM
May 30 2021 10:13 AM
Review this example that image added based on cell value :
In this template, when a cell in column A is selected, if there is picture of the cell contents is automatically shown on column F. The selected cell is also indicated by the arrow shape that we have created with VBA codes. Code snippet only was added to Worksheet_SelectionChange procedure for picture viewing.
Read more and download sample file here : Excel display image based on cell value
May 23 2017 08:01 PM
SolutionHi Gosse,
This https://excelribbon.tips.net/T010450_Displaying_Images_based_on_a_Result.html tip could help