Hi

I have three texboxes, called tbttUg1,tbttUg2 and tbttUg3. The basic is, that when i click on a "Add" button, the first textbox shows a result of an equation. When I click the second time on it, the second textbox shows a result.

the code is:
Private Sub CommandButton1_Click()
Dim bb As Integer
Dim dt As Integer

bb = tbttA.Value / (0.5 * tbttP.Value)
dt = tbttw.Value + cbttL.Value * (0.17 + 1 / tbttU.Value)
mif = 2 * cbttL.Value / (3.1415 * bb + dt) * Application.WorksheetFunction.Ln(3.1415 * bb / dt + 1)
wif = cbttL.Value / (0.457 * bb + dt)

If tbttUg1.Value = "" And dt < bb Then
tbttUg1.Value = Round(mif, 4)
ElseIf tbttUg1.Value = "" And dt >= bb Then
tbttUg1.Value = Round(wif, 4)
ElseIf tbttUg1.Value > 0 And dt < bb Then
tbttUg2.Value = Round(mif, 4)
ElseIf tbttUg1.Value > 0 And dt >= bb Then
tbttUg2.Value = Round(wif, 4)
ElseIf tbttUg2.Value > 0 And dt < bb Then
tbttUg3.Value = Round(mif, 4)
ElseIf tbttUg2.Value > 0 And dt >= bb Then
tbttUg3.Value = Round(wif, 4)
Else
MsgBox "halo"
End If

End SubThe problems it, that adding works only for two texboxes, I don't know why, but the third adding always re-writes the second one.
Does anyone sees the mistake in coding?
Furthermore, is there any better way for adding ans seeing an interim result on a single userform page?
Thanks for any kind of feedback!