ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Can I show a picture depending on what data is selected in a cell (https://www.excelbanter.com/excel-discussion-misc-queries/138716-can-i-show-picture-depending-what-data-selected-cell.html)

Lesley Murray

Can I show a picture depending on what data is selected in a cell
 
I would like to show a jpeg picture representing the data that is selected
from a dropdown list. If the value changes, I would like the picture to
change.

Dave Peterson

Can I show a picture depending on what data is selected in a cell
 
Maybe you could do something like JE McGimpsey does at:
http://www.mcgimpsey.com/excel/lookuppics.html

Lesley Murray wrote:

I would like to show a jpeg picture representing the data that is selected
from a dropdown list. If the value changes, I would like the picture to
change.


--

Dave Peterson

JMay

Can I show a picture depending on what data is selected in a cell
 
Create yourself a Userform, named Userform1 and in the code window behind the
Userform paste in:

Private Sub ComboBox1_Change()
Image1.Picture = LoadPicture("C:\CLIPART\PHOTOS\OFFICE\" & ComboBox1.Value &
".jpg") ' <<change to suit !!
End Sub

Private Sub UserForm_Initialize()
Dim i As Long
Dim Vlist As Variant
Vlist = Array("Computer", "Coffee", "Keyboard") 'Change to the Actual
Filename
For i = LBound(Vlist) To UBound(Vlist)
ComboBox1.AddItem Vlist(i)
Next i
End Sub

Also create (Using the Control Toolbox type) a combobox on the Userform,
named combobox1;


That should get you started...

Jim



"Lesley Murray" wrote:

I would like to show a jpeg picture representing the data that is selected
from a dropdown list. If the value changes, I would like the picture to
change.


JMay

Can I show a picture depending on what data is selected in a c
 
You will also have to add an Image Control to your Userform, and in the
properties window of the Image control change the Property "PictureSizeMode"
to #2 selection.


"JMay" wrote:

Create yourself a Userform, named Userform1 and in the code window behind the
Userform paste in:

Private Sub ComboBox1_Change()
Image1.Picture = LoadPicture("C:\CLIPART\PHOTOS\OFFICE\" & ComboBox1.Value &
".jpg") ' <<change to suit !!
End Sub

Private Sub UserForm_Initialize()
Dim i As Long
Dim Vlist As Variant
Vlist = Array("Computer", "Coffee", "Keyboard") 'Change to the Actual
Filename
For i = LBound(Vlist) To UBound(Vlist)
ComboBox1.AddItem Vlist(i)
Next i
End Sub

Also create (Using the Control Toolbox type) a combobox on the Userform,
named combobox1;


That should get you started...

Jim



"Lesley Murray" wrote:

I would like to show a jpeg picture representing the data that is selected
from a dropdown list. If the value changes, I would like the picture to
change.



All times are GMT +1. The time now is 07:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com