Share via

Custom Function in VBA - Error Message

Anonymous
2018-07-30T19:11:52+00:00

I would consider myself a pretty experienced excel user, but I don't know anything about VBA. I am trying to create a simple function below

Function IFZERO(number As Double, new_value)

    If (number = 0) Then

        new_value

    Else

        number

    End If

End Function

But I keep getting the following error message

"Compile error: Expected Sub, Function, or Property"

Does anyone know why I am getting this? Debugging doesn't help me.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

6 answers

Sort by: Most helpful
  1. Anonymous
    2018-07-31T19:16:08+00:00

    Thank you for all your help!!!!!

    Was this answer helpful?

    0 comments No comments