+ Reply to Thread
Results 1 to 9 of 9

VLOOUP Pictures

  1. #1
    Registered User
    Join Date
    05-07-2013
    Location
    Anchorage
    MS-Off Ver
    Excel 2007
    Posts
    42

    VLOOUP Pictures

    Friends:
    I am creating a directory of our community. I have information about the families but I would like to add picture to this information so people can easily reconcile name with pictures.

    In the attached spreadsheet I have three worksheets (1) MAIN DIRECTORY, (2) DIRECTORY and (3) PICTURES. I want to use a LOOKUP/INDEX or MATCH functions to get pictures from the PICTURES worksheet and paste them against the correct name in MAIN DIRECTORY.


    Can anyone help me to sort this out. I tried many different ways but not successful.

    Your help will be very highly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,262

    Re: VLOOUP Pictures

    I removed your merged cells in the directory cards...Steer clear from merged cells...They just cause havoc...
    See if this is what you require...
    Attached Files Attached Files
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    05-07-2013
    Location
    Anchorage
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: VLOOUP Pictures

    This is absolutely fantastic. Thank you.

    Is there any way that we can first delete the pics that are already there and then paste them again. The reason I am saying this is because if I add another name and pic to the directory and then run the macro, duplicate pics appear, i.e. same pics are pasted on top of the existing pics. Every time I run the macro, more pics are pasted.

    Thank you so much for your help.

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hi ! Try this ‼


    This is my way where a same picture can't be on several people :

    PHP Code: 
    Sub Demo1()
                
    Dim Rg As RangePict As Picture
                Set Rg 
    Sheet1.[A1].End(xlDown)
                
    Rg.Parent.Pictures.Delete
                Rg
    .Parent.Activate
                Application
    .ScreenUpdating False
        
    While Rg.Value2 0
            
    Do
                For 
    Each Pict In Sheet3.Pictures
                    
    If Pict.TopLeftCell.Row Rg.Value2 Then
                             Pict
    .Copy
                             Rg
    (46).Select
                             Rg
    .Parent.Paste
                        With Selection
                            
    .Left Rg(47).Left - .Width 1
                            
    .Top Rg(7).Top - .Height 1
                        End With
                             
    Exit For
                    
    End If
                
    Next
                   Set Rg 
    Rg.End(xlToRight).End(xlToRight)
            
    Loop While Rg.Value2 0
                Set Rg 
    Cells(Rg.Row1).End(xlDown)
        
    Wend
                Set Rg 
    NothingSet Pict Nothing
                
    [A2].Select
                Application
    .ScreenUpdating True
    End Sub 
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !
    Last edited by Marc L; 05-21-2019 at 09:21 AM. Reason: little optimization …

  5. #5
    Registered User
    Join Date
    05-07-2013
    Location
    Anchorage
    MS-Off Ver
    Excel 2007
    Posts
    42

    Thumbs up Re: VLOOUP Pictures

    Excellent!!
    I could have never done even if I tried 100 times!!

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,262

    Re: VLOOUP Pictures

    This is my way where a same picture can't be on several people :
    @ Marc L
    Nice catch...didn't even notice...

  7. #7
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Thumbs up


    Thanks for the rep' sintek !

  8. #8
    Registered User
    Join Date
    05-07-2013
    Location
    Anchorage
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: VLOOUP Pictures

    So how can we fix the problem of pasting pic over pic? Also can we put the array in a loop? I have more than 275 pics and respective names. The loop stops when end of names.

  9. #9
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,262

    Re: VLOOUP Pictures

    Marc L Solution solves...

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VLOOUP and skip blanks
    By forfiett in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-17-2016, 04:01 PM
  2. [SOLVED] INDIRECT nested in VLOOUP
    By Bobz1983 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-26-2014, 12:32 AM
  3. [SOLVED] Vlooup with multiple Arrays
    By Hassan1977 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 09-13-2013, 08:52 AM
  4. [SOLVED] vlooup input 1 and output 2
    By visha_1984 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-06-2013, 04:02 AM
  5. [SOLVED] Returning multiple Vlooup values
    By ensmith in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-13-2012, 12:27 AM
  6. Vlooup and Sums
    By garethjohn in forum Excel General
    Replies: 9
    Last Post: 04-26-2011, 09:30 AM
  7. Vlooup offset
    By Eucarionte in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-18-2009, 03:52 PM

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