HI
I create a drop down list and I have a quick question. I want to when I choose a product from dropdown list, the image of that product automatically put in other cell. is that possible ?
HI
I create a drop down list and I have a quick question. I want to when I choose a product from dropdown list, the image of that product automatically put in other cell. is that possible ?
Good time of day, aidda!
How about something like in the attachment? Step by step what I did:
1). I inserted random image in A1 ("main" sheet)
2). In cell A10 I've made a drop list from future names.
3). On sheet "Gear" I deployed a table with images and names.
4). I've made a formula for "logo" named range (browse my file).
5). I've selected image from (1) step and in formula window printed "=logo"
Best wishes and have a nice day!
There are several approaches to doing what you want.
Do you want just one product image to be displayed at a time? Or will you be selecting several/many products and you want to see an image for each?
Are you able to use VBA in the final solution?
How many product images must be available for displaly?
Will the images be stored within the workbook or on a network server?
Thank you Rioran
would you please explain me where is a logo formula ?
and do you think, is that possible to call the image from other folder?
There are several product and several images and the images on server ( in this case my computer )
For sure VB is the best solution but at this time I don't know how to use VB.
For instance when I use product 1 in cell 1 , the image should be going to cell 2. So, just one image should appear in the worksheet
and if the vb is the best way, would you please help me with VB solution ?
Aidda, I don't know how it is exactly called in English, but I'll try to explain =)
In Excel 2010 you need to open "Formulas" menu, then go to "Names manager" button (looks like three stickers above a flat box). Here you will find "logo" named range. Double click or "Change" menu will open "logo"-formula for you.
If it is not adequate to import all of your images into excel file, then yes - VBA will be more productive. By the way, you have two obvious options:
1). To import all images by VBA code.
2). Or to call images, but mechanism of this operation will differ from what I showed.
Last edited by Rioran; 12-22-2014 at 11:00 AM. Reason: Grammar
To select an image file name from a dropdown list and have Excel display the image in a range of cells:
(I can't post workbooks from my job, so I've provided instructions as an example)
Enter the path to your picture folder in a cell...Z1
...Example: C:\PicFolder\
Name that cell: PictureFolder
Select a cell that cell will hold the file name (without the path or file extension)
...It can be populated by a dropdown list...A1
...The dropdown list should contain actual file names (without the file extensions..Example: KnifflePinExtender)
Name that cell: rngDisplayName
Select a cell that will contain a formula that concatenates: the folder, file, and extension...Z2
Enter this formula in that cell: =PictureFolder&rngDisplayName&".jpg"
...Use the same file extension that your files have.
Name that cell: rngFileLocation
Select a rectangular range of cells that will be used to display the image.......A2
Name that range of cells: rngPicDisplayCells
Set the row height and column width large enough to display the image
Press ALT+F11 to open the VBA Editor
Select your workbook name in the VBA Project window
...Insert.Module
Copy the below VBA code and paste it into that window:
Please Login or Register to view this content.
Right-click the tab name in your workbook and select: View Code
Copy the below VBA code and paste it into that window:
When you change the value of the rngDisplayName cellPlease Login or Register to view this content.
...The Worksheet_Change macro detects the activity and runs the InsertPicFromFile macro, which sizes the referenced picture so it fits in the rngPicDisplayCells
Example:
If you select KnifflePinExtender
then this image will be placed in A2
C:\PicFolder\KnifflePinExtender.jpg
Is that something you can work with?
Thank you very much for you help.
But I just confused with the second part.
first I want to chose product from drop down list and then appear its picture in B6. Because I can't understand the second part I could not follow the steps ...
Last edited by aidda; 12-22-2014 at 04:08 PM. Reason: not complete
Finally I can solve my problem with Ron Coderre's solution. Thank you so much for your help and coherent explanation.
Glad you got something you can use!
I apologize for the delay. Sometimes my "real job" interferes with my forum activity.
I just have another question
How should I save it that work it again. because when I save it ordinary way it does not work again and I should put the code again.
You need to change the file type from .xlsx to .xlsm or to .xlsb so macros can be saved.
Did you do that?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks