Hello!
I have the following function:
If I call it with the following arguments:Code:Public Function Percentage2(ByVal uMaxValue As Long, ByVal uValue As Long) As Double On Error GoTo ErrHandler Percentage2 = (uValue * 100) / uMaxValue Exit Function ErrHandler: Debug.Print Err.Description Debug.Assert False End Function
I get the error 6 "Overflow" in this line:Code:Dim i% i = Percentage2(867710672, 21483520)
At first I thought I could solve it using \ instead of /, but that wouldn't help.Code:Percentage2 = (uValue * 100) / uMaxValue
Can anybody suggest how to solve this problem?
Thank you!




Reply With Quote
