+ Reply to Thread
Results 1 to 6 of 6

worksheet function vlookup . i have problem with datatype mismatch

  1. #1
    Registered User
    Join Date
    05-04-2013
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    2

    worksheet function vlookup . i have problem with datatype mismatch

    hi team, I am new to vba, I have facing problem with worksheet function vlookup. I had problem with data type mismatch.I have both text and numbers in lookup range. vlookup function finds only the value with text. I need solution to find the numbers also.

    Thanks in advance.

  2. #2
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: worksheet function vlookup . i have problem with datatype mismatch

    Hi Sakvel79..

    Welcome to the forum..

    Try to use the same formula in GRIDSHEET.. It doesn't matter is lookup range is Number / Text...
    it will works..
    Please Login or Register  to view this content.
    or do you want "101" should not display data in lookuprange.. 101(numeric).. it should display data from "101" text..

    Regards,
    Deb

  3. #3
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: worksheet function vlookup . i have problem with datatype mismatch

    See the attached workbook.
    Attached Files Attached Files
    Gary's Student

  4. #4
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: worksheet function vlookup . i have problem with datatype mismatch

    Welcome to the board.

    Use Index-Match instead. See this video.

    Since you don't show the vlookup formula, we can't offer any specific advise.

    Here's an example of two columns of data.
    Please Login or Register  to view this content.
    D2:D47 has the value to return. A2 is the search value. C2:C47 is the search column.
    David
    (*) Reputation points appreciated.

  5. #5
    Registered User
    Join Date
    05-04-2013
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: worksheet function vlookup . i have problem with datatype mismatch

    Thanks for all,

    Sorry I forgot to mentioned one thing. I am using vlookup worksheet function in userform. Please see the below code which I am using.



    Private Combobox1_change()
    Dim ws as worksheet
    set ws = worksheet("sheet1")
    textbox1.value = application.worksheetfunction.vlookup(me.combobox1.value,ws.range("a2:d50"),2,1)

    End sub.

    if I use val function: val(me.combobox1.value) text value gives lookup value. But if it is number it shows error unable to get worksheet function class.

    I need this to complete my project. Please advise is there any way to use two conditions in the above conditions

    Thanks.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: worksheet function vlookup . i have problem with datatype mismatch

    Can you upload an example workbook?

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    If posting code please use code tags, see here.

+ 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