Hi
On UserFrame I have several TextBoxes in which a user inputs a value. The names of these textboxes begins with "tbtt". As you can see I have some equations here and there. The result of those must be seen in TextBoxes tbttUg1 and tbttHg1. The question is - why I lose my decimal point???
E.g. if a usser inputs in tbttA a value 10,52 and tbttUg1.value=25,12, the tbttHg1.value=2642624. Why do I lose my decimal point???
Furhemore, does anyone know any more elegant way to show the result of an equation somewhere that is not a textbox?
Thanks for any kind of help!
Private Sub CommandButton1_Click()
Dim bb As Double
Dim dt As Double
bb = tbttA.Value / (0.5 * tbttP.Value)
dt = tbttw.Value + cbttL.Value / 10 * (0.17 + tbttR + 0.04)
mif = 2 * (cbttL.Value / 10) / (3.1415 * bb + dt) * Application.WorksheetFunction.Ln(3.1415 * bb / dt + 1) 'moderately insulated floor
wif = (cbttL.Value / 10) / (0.457 * bb + dt) 'well insulated floor
DispText = Round(IIf(dt < bb, mif, wif), 4)
If Len(tbttUg1.Value) = 0 Then
tbttUg1.Value = DispText
tbttHg1.Value = tbttA.Value * tbttUg1.Value
ElseIf Len(tbttUg2.Value) = 0 Then
tbttUg2.Value = DispText
tbttHg2.Value = tbttUg2.Value * tbttA
ElseIf Len(tbttUg3.Value) = 0 Then
tbttUg3.Value = DispText
tbttHg3.Value = tbttUg3.Value * tbttA
Else
MsgBox "halo"
End If
Bookmarks