Results 1 to 5 of 5

vba: find command, finding exact values

Threaded View

  1. #1
    Registered User
    Join Date
    09-03-2010
    Location
    england
    MS-Off Ver
    Excel 2010
    Posts
    19

    vba: find command, finding exact values

    I have tried using the vlookup function in VBA, but that has failed to work.
    I am now using the following code instead:

    Sheets("sheet1").select
    Textbox2.text= ActiveSheet.Range("A:J").Find( _
    What:=Textbox10.text,matchcase:=false, _
    SearchOrder:=xlByColumns).Offset(0,1).Value

    This returns into textbox2 the value found in the second column of the spreadsheet which corresponds to the value in textbox10. My problem is that the values I have in the 1st column (the column containing the lookup value) are numbers and the code I am using seems to be finding the value which corresponds to the first number which has the number entered in textbox10 nested in it rather than the exact number itself.
    For example, the list of numbers I have in column 1 are
    135
    35
    100
    If the value in textbox10 is 35, the value I get in textbox2 corresponds to the first number in the list containing 35, that is 135, rather than the exact number 35 itself. How can I solve this?

    Thanks!
    Last edited by icylemontea; 09-11-2010 at 02:50 PM.

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