You haven't told the function to return anything.
I assume you want to return the value of
If that is the case, prior to the
End Function add the following line:
insurancebonus = Total
This specifies that your function should return the value of
As a very short and contrived example, this function simply returns 1.
Public Function test() As Integer
test = 1
The point is that you must assign the value to the name of your function.
For completeness, if your function returns an Object type you must use the
Set keyword, such as:
Public Function testRange() As Range
Set testRange = Range("A1")
Which would return a Range object.