Hello!

I have the following function:

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
If I call it with the following arguments:

Code:
       Dim i%
       i = Percentage2(867710672,  21483520)
I get the error 6 "Overflow" in this line:

Code:
       Percentage2 = (uValue * 100) / uMaxValue
At first I thought I could solve it using \ instead of /, but that wouldn't help.

Can anybody suggest how to solve this problem?

Thank you!