blackie42
10-23-2008, 03:39 AM
Hi
I'm developing some compensation calculators and have the following code in a userform.
Sub CALCULATE()
Dim X As Integer
X = (TextBox1.Value / TextBox2.Value) - (TextBox1.Value / TextBox3.Value)
If X <= 1 Then
MsgBox ("Disadvantaged by " & X & " shares")
Else
MsgBox ("Advantaged by " & X & " shares")
End If
End Sub
I'd like the message box to display the value of X to 3 DP.
Any help appreciated
thanks
I'm developing some compensation calculators and have the following code in a userform.
Sub CALCULATE()
Dim X As Integer
X = (TextBox1.Value / TextBox2.Value) - (TextBox1.Value / TextBox3.Value)
If X <= 1 Then
MsgBox ("Disadvantaged by " & X & " shares")
Else
MsgBox ("Advantaged by " & X & " shares")
End If
End Sub
I'd like the message box to display the value of X to 3 DP.
Any help appreciated
thanks