+ Reply to Thread
Results 1 to 4 of 4

userform textbox calculation

  1. #1
    Registered User
    Join Date
    01-27-2008
    Posts
    30

    userform textbox calculation

    Hello

    I Have a Userform that has 4 textboxes on it.


    Control Value
    textbox1 2
    textbox2 +
    textbox3 3
    textbox4 Results

    so basicly textbox2 will give me the sum of textbox1 + textbox3 = textbox4.text = 5 wich is the results.

    usually the formula or vba i use is

    textbox4 = VAL(textbox1) + VAL(Textbox3)
    but i need something like
    textbox4 = Val(textbox1) And VAL(textbox2) + VAL(textbox3)

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    This userform code assumes four text boxes,

    TextBox1 holds a numeral
    TextBox2 holds a symbol; + - * / ^
    TextBox3 holds a numeral

    TextBox4 will display the result of the calculation.

    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Another option:
    Please Login or Register  to view this content.

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    Nice!

    I need to remember Evaluate.

+ 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