+ Reply to Thread
Results 1 to 4 of 4

VBA to display text on user form based on range of values in another field on the form

  1. #1
    Registered User
    Join Date
    12-02-2011
    Location
    Coventry, England
    MS-Off Ver
    Excel 2010
    Posts
    47

    VBA to display text on user form based on range of values in another field on the form

    A point in the right direction is greatly appreciated:

    I have a user form that I have created and there is a score field that a user can enter a value from 0 - 100 called txtScore and the result field is txtResult.


    If the value in txtScore is between 0 - 49 the value in txtResult is Critical
    If the value in txtScore is between 50 - 75 the value in txtResult is Amber
    If the value in txtScore is between 76 -100 the value in txtResult is Develop


    I'm struggling a little bit to get it to work - In an excel spreadsheet I got it to work by looking at a sheet called LookupLists old but I am struggling to do something similar in the user form;

    =LOOKUP(2,1/('LookupLists old '!A3:A5<=F21)/('LookupLists old '!B3:B5>=F21),'LookupLists old '!C3:C5)

    Performance Bandings:
    A B C
    Lower Higher Comment
    3 0% 49% Critical
    4 50% 75% Amber
    5 76% 100% Develop

    Please can anyone point me in the right direction of how I should be going about it so I can research it?


    Many thanks

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: VBA to display text on user form based on range of values in another field on the form

    To get you started.
    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Registered User
    Join Date
    12-02-2011
    Location
    Coventry, England
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: VBA to display text on user form based on range of values in another field on the form

    Thank you so much! It works and I can use that to continue with it . I hadn't even thought to do it that way and got hung up researching vlookups which I couldn't get to work. Thank you that has really helped. I can use that for other areas on my form now too.

    Greatly appreciated.

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: VBA to display text on user form based on range of values in another field on the form

    Glad to help and thanks for Rep+.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Populate text boxes on user form, from combo box on same user form
    By Richardswaim in forum Excel Programming / VBA / Macros
    Replies: 26
    Last Post: 07-03-2016, 09:35 AM
  2. [SOLVED] User Form to execute search and return all values to the user form for editing
    By allwrighty in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-11-2013, 10:40 PM
  3. [SOLVED] Conditionally Sum Values in Column and Display Sum in Form Field
    By Southfish in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-22-2012, 08:14 PM
  4. Text box field reference in a user form
    By SinGin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-09-2010, 09:52 PM
  5. Text field visible property on user form
    By JChandler22 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-22-2010, 02:44 PM
  6. user form question: text box to display result
    By BigPig in forum Excel General
    Replies: 0
    Last Post: 02-27-2006, 08:40 PM
  7. user form question: text box to display result
    By BigPig in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-25-2006, 04:20 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