Hello guys,
I am new in the forum. I am posting beacuse I have an issue with my userform, where I am triyng to compare 2 values through a simple routine.
The value are entered by the user in 2 textboxt. The code attached to my button is someting like:
if A > B then
textbox3.value = A
else
textbox3.value = B
the point is that, for example, if A = 256 and B = 166,6 the result of A > B is "true", but if A = 1000 and B = 166,6 then the result of A > B is "false". Please see the 2 attached screenshot that explain this.
Here is my code:
-----------------------------------------------------------------------------------------------------------------
Private Sub CalculateButton_Click()
Me.TboDimweight.Value = (Me.TboHeight.Value * Me.TboLenght.Value * Me.TboWidth.Value) / 6000
MsgBox Me.TboWeight.Value > Me.TboDimweight.Value
If Me.TboWeight.Value > Me.TboDimweight.Value Then
Me.TboCharweight.Value = Me.TboWeight.Value
Else
Me.TboCharweight.Value = Me.TboDimweight.Value
End If
End Sub
-----------------------------------------------------------------------------------------------------------------
Please help me!
Thank you.
Bookmarks