Closed Thread
Results 1 to 7 of 7

VLOOKUP For Pictures

  1. #1
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    VLOOKUP For Pictures

    I am creating a worksheet that will have a list of items in column D staring at D05 and then D10, D15, D20 etc.

    In column J, I would like to paste a picture related to the item name in column D.

    So if D10 says carol, J10 would have carol's picture.

    All pictures will be loaded in sheet1. VLOOKUP table will be created on sheet2.

    I am using the example found on this forum and it works fine.

    However in my case, some times the pictures would have to be pasted more than once.

    So if D10 and D25 have same name, I would like to have the same picture in two places.

    Any idea on how to modify the code to do that?

    I am attaching a sample workbook with the code.

    Thanks,
    modytrane
    Attached Files Attached Files
    Last edited by modytrane; 03-11-2009 at 09:32 AM. Reason: resolved [thanks to Andy]

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437

    Re: VLOOKUP For Pictures

    You would need to create additional images in order to have multiple occurances.

    Here is a non vba solution.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: VLOOKUP For Pictures

    Thanks Andy.
    It works and serves my purpose.
    I was just curious about what the VBA solution would be.
    I feel the VBA would offer more flexibility.
    I can understand multiple pictures. But how would you pick a copy of the same picture for a given name?
    Each copy of a picture would have same name and the macro would have to find next available copy until it runs out and gives you a message or something.

    Anyway, thanks and if you or someone has time they might respond with a VBA soultion. If there are no responses here in a week, I will mark this thread solved.

    modytrane.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437

    Re: VLOOKUP For Pictures

    Here is how I would do it.

    Firstly the code is now against the Change event rather than calculate.
    It creates a copy of the require picture on the active sheet. The original pictures are on Sheet2.
    It names the newly copied shape in reference to the changed cell. Deleting the shape before create a copy of the next person selected.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: VLOOKUP For Pictures

    Thanks Andy,
    Works perfectly.
    Have good day,
    modytrane.

  6. #6
    Registered User
    Join Date
    02-19-2009
    Location
    VA
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: VLOOKUP For Pictures

    Hope you guys don't mind adding another problem to this post....

    I have the same exact issue with a spreadsheet I am working on. I used the OPs original code and managed to get multiple pictures, but not the same picture in two different locations.

    Here's a post I put up yesterday: http://www.excelforum.com/excel-prog...-pictures.html

    I tried to use the code that Andy posted above, but can't seem to get it to work.

    I downloaded the OPs spreadsheet and applied Andy's code and got it to work as intended, but can't get it to work with my spreadsheet.


    If you guys could take a look at my issue, I would truly appreciate it. I have been messing with this for too many hours.

  7. #7
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988

    Re: VLOOKUP For Pictures

    fourwhls,

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread.

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

Closed Thread

Thread Information

Users Browsing this Thread

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

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