Function Tax(ProfitBeforeTax As Double) As Double If ProfitBeforeTax > 0 Then Tax = 0.3 * ProfitBeforeTax Else Tax = 0 End Function Sub test() MsgBox Tax(100) End Sub