+ Reply to Thread
Results 1 to 3 of 3

VBA Lookup problem...

  1. #1
    Forum Contributor Stuie's Avatar
    Join Date
    09-17-2006
    Location
    Suffolk, UK
    MS-Off Ver
    Excel 2003/2007
    Posts
    432

    VBA Lookup problem...

    basically i got a database that i have made user forms for data entry and i want to use a form which will retrieve the records based of a criteria... i have tried vlookup but it will only retrieve the first record example...

    name ¦ surname ¦ age ¦
    john ¦ doe ¦ 58 ¦
    bob ¦ smith ¦ 24 ¦
    john ¦ doe ¦ 23 ¦

    now what i need is a function that would return both john doe records instead of just the first one if i searched by the surname.

    if any1 has a answer it wud be most appreciated

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Did you mean that you want to populate a listbox within the UserForm?

    this would be VB code that included:
    Please Login or Register  to view this content.
    plus, of course, many other lines to the box.

    VLookup is used in Formula, and normally returns one value for the current cell (the cell that contains the VLookup).

    hth
    ---

    Quote Originally Posted by Stuie
    basically i got a database that i have made user forms for data entry and i want to use a form which will retrieve the records based of a criteria... i have tried vlookup but it will only retrieve the first record example...

    name ¦ surname ¦ age ¦
    john ¦ doe ¦ 58 ¦
    bob ¦ smith ¦ 24 ¦
    john ¦ doe ¦ 23 ¦

    now what i need is a function that would return both john doe records instead of just the first one if i searched by the surname.

    if any1 has a answer it wud be most appreciated

  3. #3
    Forum Contributor Stuie's Avatar
    Join Date
    09-17-2006
    Location
    Suffolk, UK
    MS-Off Ver
    Excel 2003/2007
    Posts
    432
    cool thanks mate i will give tha ago when i get home

+ 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