+ Reply to Thread
Results 1 to 8 of 8

pull pictures by using Vlookup?

  1. #1
    all4excel
    Guest

    pull pictures by using Vlookup?

    I have a two tabs
    1. Picture Database
    2. Reports.

    In the 1st tab- Picture Database I have stored pictures in the column C from C2 till C21 and the Picture Ids are in the column B from B2 till B21.

    Now is it possible for me to use something to retrieve the pictures based on their IDs, the way we normally use in Vlookup.

    Like Vlookup(Picture ID,Range (ColB:C),2,false)..

    please advise.

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444
    Hi,

    You can do this by making you pictures visible and invisible dependant on a cell value. For example:

    Please Login or Register  to view this content.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    all4excel
    Guest

    Thanks Dave

    Just one question Is it possible to do this MS Excel?
    and also be able to change the reference.

    In VBA also it is possible to change the reference by providing the range somewhere, the way we use INDIRECT function.?

  4. #4
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444
    Can you post your workbook? Or an example?

  5. #5
    all4excel
    Guest

    Smile Certainly Dave...!

    Quote Originally Posted by sweep
    Can you post your workbook? Or an example?

    I am attaching a file..
    I want the Picture to be pulled the way we use Vlookup?

    Please go thru the file...

    Can I have this done completely in MS Excel if possible...

    And if you are doing it in VBA please explain as I dont understand VBA.

    What if I cahnge the position of the Pictures in the Picture tab from column B..

    allexcel..
    Attached Files Attached Files

  6. #6
    all4excel
    Guest

    Any Idea Guys.!

    I need to use the Pictures the way we use any lookup functions.

    Is that possible in MS Excel?

  7. #7
    Forum Contributor
    Join Date
    09-25-2004
    Posts
    269
    Here is a formula version. I used define name range formulas for this.



    Hope it helps!
    Attached Files Attached Files
    Last edited by vane0326; 03-06-2008 at 01:11 PM.

  8. #8
    all4excel
    Guest

    Smile Great Vane.

    But can u please explain as to how this was achieved?

    And how do i drag it down like Vlookup?

    Please elaborate...

  9. #9
    Forum Contributor
    Join Date
    09-25-2004
    Posts
    269
    Quote Originally Posted by all4excel
    But can u please explain as to how this was achieved?

    And how do i drag it down like Vlookup?

    Please elaborate...

    I created 4 name range formulas, Like this...

    Pic1 =INDEX(Sheet2!$B:$B,MATCH(Sheet1!$A$2,Sheet2!$A:$A,0))
    Pic2 =INDEX(Sheet2!$B:$B,MATCH(Sheet1!$A$3,Sheet2!$A:$A,0))
    Pic3 =INDEX(Sheet2!$B:$B,MATCH(Sheet1!$A$4,Sheet2!$A:$A,0))
    Pic4 =INDEX(Sheet2!$B:$B,MATCH(Sheet1!$A$5,Sheet2!$A:$A,0))


    To learn more about Define Name range formulas here is a link below.

    http://www.contextures.com/xlNames01.html

    I don't know no other way. I do understand you want to just drag the formula down like keeping it as a relative reference. But it doesn't work that way. Maybe some other more experience formula gurus on this board could do it. If not then VBA is the way to go and unfortuanly I'm not a programmer.

    Hope that helps!

  10. #10
    all4excel
    Guest

    Question Need some more help!

    [QUOTE=vane0326]I created 4 name range formulas, Like this...

    Pic1 =INDEX(Sheet2!$B:$B,MATCH(Sheet1!$A$2,Sheet2!$A:$A,0))
    Pic2 =INDEX(Sheet2!$B:$B,MATCH(Sheet1!$A$3,Sheet2!$A:$A,0))
    Pic3 =INDEX(Sheet2!$B:$B,MATCH(Sheet1!$A$4,Sheet2!$A:$A,0))
    Pic4 =INDEX(Sheet2!$B:$B,MATCH(Sheet1!$A$5,Sheet2!$A:$A,0))

    -----------------------------------------------------------------------
    As far as your formula goes it gives the required result however I would have to Define the Names for each photo which would be tedious..Is there a Drag and Drop easier way...

    I am also open to change the Design /Layout of my Table..

    Purpose:
    Im trying to make a file on Cricket for my organisation , I would like to put a photo of each player in the main DATA file where I mention all their information..

    Now I would have a TAB called Achievements where I would have a Drop-down containing a List of all Player,On selecting the name I would get all the other information by using a Vlookup Now how do I get the photos displayed next to the name of the player..

    If there's any other way I can get to do this please advise even by changing the design or even by using VBA if possible but please explain...


    I hope I have explained well this time...
    Last edited by all4excel; 03-16-2008 at 03:21 AM.

  11. #11
    all4excel
    Guest

    Question No reply as yet

    Bump Bump Bump Bump Bump Bump Bump Bump Bump Bump

  12. #12
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Hello all4excel,

    Sorry to impose on this thread - I tried to PM you on another matter but your inbox appears to be full, suggest you clear some old messages.....

  13. #13
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,613
    Ben Van Johnson

  14. #14
    all4excel
    Guest

    Question It did help but...!

    Quote Originally Posted by protonLeah

    IS there a simpler way of doing tht the way we use drag and drop methods, in this we have to demarcate every picture by the number of columns and rows..?

  15. #15
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,613

    An alternative

    1. Save your pictures to a new folder on some drive
    2. Insert a new module and insert the following code:
      PHP Code: 
      Option Explicit
      Public PicArray() As String 
    3. Next, in the ThisWorkbook module, insert:
      PHP Code: 
      Option Base 1
      Private Sub Workbook_Open()
            
      Dim fs As ObjectAs Integer
            Set fs 
      Application.FileSearch
            With fs
                  
      .LookIn "C:\dbpix"       '<========== replace w/ your folder name'
                  
      .SearchSubFolders True
                  
      .Filename "*.jpg"         '<===== or *.gif, etc'
                  
      If .Execute() > 0 Then
                        ReDim PicArray
      (1 To .FoundFiles.Count)
                        For 
      1 To .FoundFiles.Count
                               PicArray
      (i) = .FoundFiles(i)
                        
      Next i
                  End 
      If
            
      End With
      End Sub 
    4. Finally, in the code module for the "Pull" sheet:

      PHP Code: 
      Private Sub Worksheet_Change(ByVal Target As Range)
             
      Dim SerialNos As RangePicNum As Integer,  isectPic_URL As String
             
             Set SerialNos 
      Range("A:A")     'you could add code to find the last row'
             
      Set isect Application.Intersect(SerialNosTarget)
             If 
      Not isect Is Nothing Then
                  PicNum 
      Target.Value
                  Pic_URL 
      PicArray(PicNum)
                  
      Target.Offset(02).Select
                  ActiveSheet
      .Pictures.Delete      '<====  delete any current picture'
                  
      ActiveSheet.Pictures.Insert(Pic_URL).Select
            End 
      If
      End Sub 
    Suggestion:
    If you have less than 100 pics, you should name the picture files "01-Blinky, 02-nnnn,...,99-nnnn, in the order YOU want them so that the file system doesn't order them alphabetically.

  16. #16
    all4excel
    Guest

    Question Dear Pro...

    Thanks for your efforts

    I will check and let you know..

    I need to collect some pictures for the same..

    However Is it possible by using some formulas?

    all4excel.

  17. #17
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,613
    I may be wrong, but, I don't think it's possible to access graphics with formulas in cells.

    It's my understanding that graphics are on a separate layer "above" the cells, not "in" the cells as are the values.

    So, for example, I you can't insert graphics in column B of a table and use Vlookup of a value in column A and have it fetch the graphic.

    The thought occurs to me that a table of URL's (path's to a folder, in this case), that might work with VLOOPUP, but...(?)

+ Reply to 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