Request help with Arithmentic UDF
Please tell me why this isn't working.
Function SumInvoice(myC As Range) As Long
Dim Est As Long
Dim Fore As Long
Dim Prev As Long
Est = myC.Offset(0, 3).Value + Cells("K134")
Fore = myC.Offset(0, 4).Value + Cells("K135")
Prev = myC.Offset(0, 5).Value + Cells("K136")
If myC.Cells.Text < "Z*" Then
SumInvoice = 0
ElseIf Est 0 Or Fore 0 Then
SumInvoice = (Est + Fore) - Prev
Else: SumInvoice = 0
End If
End Function
|