27-04-13, 08:47 AM
قمت ببرمجتها والحمد لله وهذا هو الكود للاستفادة وشكرا لأخواننا
كود :
If Val(Text6.Text / 2) < 4 Then
Text8.Text = 4
End If
If Val(Text6.Text / 2) > 4 Then
Text8.Text = Round2Digit(Val(Text6.Text / 2))
End If
End Sub
Private Function Round2Digit(num As Integer)
If (num >= 2) And (num Mod 2) = 0 Then
Round2Digit = num
Exit Function
End If
Round2Digit = num Mod 2
If Round2Digit >= 4 Then
Round2Digit = num - Round2Digit + 9
Else
Round2Digit = num - Round2Digit + 2
End If
If num = 0 Then Round2Digit = 0
End Function