+ Reply to Thread
Results 1 to 11 of 11

Displaying results of Vlookup

  1. #1
    Forum Contributor
    Join Date
    01-21-2015
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    116

    Displaying results of Vlookup

    Hi,

    I have attached the workbook. Upon a 6 digit being entered into a textbox it looks within the number range and displays the corresponding result, Answer 1,2 and 3.

    What am I doing wrong?

    Any help really appreciated

    lookup.xlsm

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,226

    Re: Displaying results of Vlookup

    I assume that the entry in D8 is a mistake. a) it is lower than C8 and b) it is lower than your lookup value. Its value does not make any difference to the lookup itself; however. Was this what you were expecting to see?
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Valued Forum Contributor
    Join Date
    10-05-2014
    Location
    Regina, SK Canada
    MS-Off Ver
    Excel for Mac 11
    Posts
    330

    Re: Displaying results of Vlookup

    The parameters to your VLOOKUP are incorrect.
    ex Textbox4 probably has the value to search for in Vlookup.
    The range for the lookup table should be C5:H8.
    The results will be found in columns 4, 5 and 6 of the range.
    Check Excel's Help file for details on VLOOKUP.

    Also, you are attempting to store all 3 results in one text box.

    Try this..

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    01-21-2015
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    116

    Re: Displaying results of Vlookup

    Hi Glenn

    Yes D8 was a mistake. I have a list of ranges in C&D and if it falls within the range it outputs the three different answers. I guess a better example would be a value of 125000 should reveal answers C D E.

    Thank you

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,226

    Re: Displaying results of Vlookup

    Quote Originally Posted by chrisandsally View Post
    I guess a better example would be a value of 125000 should reveal answers C D E.

    ...which is what the formula in the sheet I posted above does return.

  6. #6
    Forum Contributor
    Join Date
    01-21-2015
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    116

    Re: Displaying results of Vlookup

    Yes, you are right. In the file you sent above the code requires a password, how can i see the code? Or are you still looking at it?

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,226

    Re: Displaying results of Vlookup

    Ooops. I just noticed that this is in the VBA forum. I just used a regular formula. If it's VBA you're after - I'm out... I'm no use with VBA!

  8. #8
    Forum Contributor
    Join Date
    01-21-2015
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    116

    Re: Displaying results of Vlookup

    No Problem, thanks anyway

  9. #9
    Forum Contributor
    Join Date
    01-21-2015
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    116

    Re: Displaying results of Vlookup

    StuCram

    Thank you for your help on this. I have attached a revised Workbook however still as some errors. Please could you take another look?

    lookup2.xlsm

  10. #10
    Valued Forum Contributor
    Join Date
    10-05-2014
    Location
    Regina, SK Canada
    MS-Off Ver
    Excel for Mac 11
    Posts
    330

    Re: Displaying results of Vlookup

    I've modified your 'Lookup2' sample file and attached the newer version.

    Summary of Changes:
    - added a 'Close' button
    - added a button and code to show the user form
    - Defined a range in the lookup routine for the data area
    ---- this simplifies the vLookup formulas and makes changes to the range easier
    - Created and used a numeric variable (type Long)
    ---- This also simplifies the vLookup formulas and ensures the correct data type
    - Modified the data table to check for values that are too small or too big (Shown in grey but likely hidden)

    Hope this helps

    lookup2.xlsm

  11. #11
    Forum Contributor
    Join Date
    01-21-2015
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    116

    Re: Displaying results of Vlookup

    Thank you very much, a star.

+ 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. Displaying results from Database
    By Pule in forum Access Tables & Databases
    Replies: 3
    Last Post: 01-20-2011, 05:00 PM
  2. Displaying multiple results using VLOOKUP or similar
    By soulsam in forum Excel General
    Replies: 5
    Last Post: 12-19-2009, 11:11 AM
  3. Displaying multiple results with VLOOKUP
    By buffalobill in forum Excel General
    Replies: 7
    Last Post: 12-08-2009, 08:56 PM
  4. Displaying Corresponding Results
    By freeman in forum Excel General
    Replies: 1
    Last Post: 07-05-2007, 12:05 PM
  5. displaying results
    By n1ima in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-02-2007, 01:48 PM

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