+ Reply to Thread
Results 1 to 2 of 2

search for specific data in two columns and if it matches returns an ID number

  1. #1
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    115

    search for specific data in two columns and if it matches returns an ID number

    Hi,

    I have created user form that searchs for specific data in two columns and if it matches returns the ID number.

    I dont know why but the code it's not working. I've done it before using two comboboxes and it worked great but now, i can't seem to get it right.

    The file is in attach.

    Can anyone help?

    Thanks
    Attached Files Attached Files
    Last edited by ncaravela; 10-29-2013 at 09:19 AM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: search for specific data in two columns and if it matches returns an ID number

    Hello ncaravela,

    You had 2 problems. First you were searching in column 15 when it should have been column 14. Second, the values in a ComboBox list are always string data types. The values on the worksheet are numbers in column 15. This will throw a "Type Mismatch" error. The solution is to return the cell's value as a string using the Text property. The code below has the changes made.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ 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. ListBox1 only returns 10 columns of data from a search
    By StartingOut in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-28-2012, 07:53 AM
  2. Replies: 0
    Last Post: 08-11-2012, 03:25 PM
  3. Search & display a specific format in a number of columns using lookup
    By sarahhllmn in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-15-2011, 06:48 AM
  4. Search (match) through columns and find ALL matches
    By qz33 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-11-2008, 08:58 PM
  5. [SOLVED] Search for a number in a table and return data of a specific cell
    By Karaman in forum Excel General
    Replies: 4
    Last Post: 06-30-2006, 10:50 AM

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