Hi,
Maybe you can adapt this to your needs.
There must be a more elegant way, but I
couldn't find one.
Place two text boxes and a button on the form
to try it.
Copy and paste this code into your code module.
HTH
Rowland
Private Sub Command1_Click()
Dim IntPart As Integer
Dim DecPart As Double
Dim RoundedNum As String
Dim RndPart As String
Dim AddOne As Integer
Select Case DecPart
Case Is < 0.25
RndPart = ".0"
Case 0.25 To 0.75
RndPart = ".5"
Case Is > 0.75
AddOne = 1
RndPart = ".0"
End Select
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.