+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 22

Pictures in Drop Down Selection

  1. #1
    Registered User
    Join Date
    03-25-2020
    Location
    Illinois
    MS-Off Ver
    2016
    Posts
    10

    Pictures in Drop Down Selection

    Would it be possible to insert pictures as a "comment" when a specific item is selected from a drop down?

    I am working on an existing equipment parts spreadsheet and want to add pictures for each part number. The drop down selects the description and the item number is generated in a non-editable cell two columns to the right. See below screenshot. Ideally the picture would only appear when the mouse hovered over, similar to a comment. The picture display location isn't important as long as it could be displayed. The non-editable cells must remain, so no one changes the part codes by accident.

    In a related thread additional text comments were able to be created in this manner. The thread was called "comments for drop down list items?", unfortunately I can't post a link at this time.

    Screenshot Example.JPG

    Thank you for the assistance!

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2016
    Posts
    5,846

    Re: Pictures in Drop Down Selection

    Hi maybe this link will help.
    I would do it in a cell, but a comment is possible
    https://www.thespreadsheetguru.com/t...o-cell-comment
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    03-25-2020
    Location
    Illinois
    MS-Off Ver
    2016
    Posts
    10

    Re: Pictures in Drop Down Selection

    Thanks Keebellah for the resource!

    The challenge with this is the drop down will need the cell picture to change as well. I am able to insert a picture for one part number but the drop down contains multiple different items acting on the same active cell. Unless I'm not understanding the VBA correctly.

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2016
    Posts
    5,846

    Re: Pictures in Drop Down Selection

    I didn't look into the code but this would be the idea, the image changes depending on what you 'trow' at it.
    So all you need to do is clear the image already present and replace it with the new one, but if it's only the picture you want to see you could also use a userform

  5. #5
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2016
    Posts
    5,846

    Re: Pictures in Drop Down Selection

    May I assume that the images are all the same type (jpg or gif or something like that) and all in a separate folder?

  6. #6
    Registered User
    Join Date
    03-25-2020
    Location
    Illinois
    MS-Off Ver
    2016
    Posts
    10

    Re: Pictures in Drop Down Selection

    Correct. They can be jpg and stored in a separate folder.

    I don't have much experience with userforms but if that seems to be the easiest method I'm open to that. Seeing the possibility of having a comment box update based on the selected drop down showed me this might be possible to do with pictures.

    Thanks for the attention and response on this.

  7. #7
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2016
    Posts
    5,846

    Re: Pictures in Drop Down Selection

    Could you attach a dummy sample file with 2 or three image files and the folder name they're in? Will make it easier to help

  8. #8
    Registered User
    Join Date
    03-25-2020
    Location
    Illinois
    MS-Off Ver
    2016
    Posts
    10

    Re: Pictures in Drop Down Selection

    Sure, see attached spreadsheet. This is a small sample of the existing sheet but it has the same functionality.

    I couldn't attach pictures in excel due to size limits. The photos I tried to attach were much too large of a size. Any photo will work, sorry I couldn't include this.
    Attached Files Attached Files

  9. #9
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2016
    Posts
    5,846

    Re: Pictures in Drop Down Selection

    No problem I'll take a look and see how I can help you.
    I'll download the file an update when I have something for you

  10. #10
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2016
    Posts
    5,846

    Re: Pictures in Drop Down Selection

    This is what I came up with the following

    You must chance this first:
    The red underlined text: place the fullpath to your image folder here
    Please Login or Register  to view this content.
    I've attached on image file named 'NoImage.jpg" make sure it's in your image folder

    Just select the equipment form your dropwdown in column A.
    The code only checks A6 and A7
    Hope it works on your side
    Attached Images Attached Images
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    03-25-2020
    Location
    Illinois
    MS-Off Ver
    2016
    Posts
    10

    Re: Pictures in Drop Down Selection

    That is exactly the functionality needed. Thank you.

    There was an error though. I updated to the file location but the picture isn't being found. I verified the file type is a ".jpg". See attached. The two pictures in the file are named "Equipment B" & "Equipment C".

    Do I need to name the pictures anything specific?
    Attached Images Attached Images

  12. #12
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2016
    Posts
    5,846

    Re: Pictures in Drop Down Selection

    I assumed that it would be the part code,
    Like this.
    The number, the image is random
    Attached Images Attached Images
    Last edited by Keebellah; 03-26-2020 at 06:44 PM. Reason: attachments added

  13. #13
    Registered User
    Join Date
    03-25-2020
    Location
    Illinois
    MS-Off Ver
    2016
    Posts
    10

    Re: Pictures in Drop Down Selection

    Fixed. I should have assumed that. I have two last questions in scaling this up.

    1) How can I scale this so it applies to many cell rows with a gap between cell rows? The final spreadsheet will have 4-8 consecutive rows followed by a spacer cell, and this will repeat. See picture for final format.

    2) I increased the scale value but the image did not become larger, is there another part of the code to modify for a larger image?
    Attached Images Attached Images

  14. #14
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2016
    Posts
    5,846

    Re: Pictures in Drop Down Selection

    Try this
    The image is shown in a user from.

    The condition is that the range to check is column A (or whatever you change it to but that contains the equipment description, and the column next to it contains the Equipment code
    This works much better that a Comment

    modules are a userform and a unused GeneralPurposemodule that now holds the path.
    The idea is to make that interactive but this for testing and see if it's better since scaling works better
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    03-25-2020
    Location
    Illinois
    MS-Off Ver
    2016
    Posts
    10

    Re: Pictures in Drop Down Selection

    I encountered an image path error, see attached. This was the same file location that worked with the previous method so it seems to be the correct location.

    The final format will have a column ("Qty") between the description and part code. Would I just change the "target offset" from 1 to 2 to correct for this? I attached the formatted sample.
    Attached Images Attached Images
    Attached Files Attached Files

+ Reply to Thread
Page 1 of 2 1 2 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1