Hi stackoverflow community, I have issue with the following code, I'd like to create a Function that if "CONDITION" is true then sum the selected cells and if not subtract.
Function balance(condition As Double, amount As Integer, residue As Integer)
If condition = "PAGO" Or "PAGO AGENC" Then
balance = amount - residue
ElseIf Tipo = "DEBITO" Then
balance = amount + residue
End If
balance = Application.Round(balance, 2)
End Function