Calculations Using UserForm TextBox Controls

  • Userform has textboxes for input / output, as well as combobox1 & 2 to load data into form and sheet in background. I have been trying to program it so that the user can simply change the text box prices and costs, and it updates on the fly. It works perfectly with only with one input textbox (Price) but when I add the Cost textbox, I get a runtime error 13 message. In my code, if I switch the order of the textbox.value in the initialize, it will read the cost, but not the price. Here is the code.

    here is the subroutine that calls the data, the error shows up where the rategs variable will have the value of 345, the orategs will show ""; if in the initialize event above I put textbox10.value first, then textbox9.value, orategs will read 517.5, rategs reads "". When I debug, if I go to the initialize and hover over the textbox values one will read a number, and the second will read the "".

    ANY IDEAS? :

  • Re: Calculations Using UserForm TextBox Controls

    Can you post your workbook, or simulate a small workbook with your problem?
    Should be a small issue here, I see nothing wrong in your code at irst sight.

  • Re: Calculations Using UserForm TextBox Controls

    What kind of object is Formula_One (Textbox, Combobox, Userform ) ? (I assume a Userform).
    Never use Additem to fill a Combobox/Listbox

    You can achieve similar results using less variables and less write-actions (faster !)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!