Code:
Public Function Test(iRange As Range)
Dim tmp As Integer
If Application.IsNumber(Range(iRange).Value) And Range(iRange).Value > 0 Then
tmp = Range(iRange).Value
Else
tmp = 100
End If
Test = tmp
End Function
I am passing a cell as argument and checking if the cell value is number and >0. But above function showing me value error. What did I do wrong here?