Insert Pic based on Selection

rfletcher35

Active Member
Joined
Jul 20, 2011
Messages
300
Office Version
  1. 365
Platform
  1. Windows
I have a sheet called "Main" In Cell B3 I have a drop down list, Whatever I choose here I want a picture to appear on Main starting in Cell E3

I can either have the pictures stored on another Sheet or from a Folder which ever is easiest, by choice i'd like it to locate the pic from another sheet.

This doesn't sound too complicated but I can't get my head around it.

Please help me!!!


Fletch
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
I guess that you mean "a different picture for each value you will input in B3"

For example:
-load the images directly in sheet Main
-make sure that the name of the images is exactly the value that you will input in B3 (that is, create a validation list using the images name)
-right-click on the tab with the name Main; chose Display code, to open the macro editor; copy the following code and paste it into macro editor:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim SHP As Shape
If Target.Address = "$B$3" Then
    For Each SHP In ActiveSheet.Shapes
        If SHP.Type = 13 Then
            If SHP.Name = Target.Value Then
                SHP.Visible = True
            Else
                SHP.Visible = False
            End If
        End If
    Next SHP
End If
End Sub
Now if you select a value in B3 only the corresponding image should be visible.

Bye
 
Upvote 0

Forum statistics

Threads
1,214,386
Messages
6,119,214
Members
448,874
Latest member
b1step2far

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