Hi
I want it to work just like it does in regular Excel - but it always gives me an error message (see the attached picture)
I am enclosing a VERY simple sample macro (see below)
When I run it, I get a "division by zero" instead of "X" becoming a 0
This seems simple, but I cannot figure it out
THANK YOU!
Sub TestIferror()
Dim X As Integer
X = WorksheetFunction.IfError(1 / 0, 0)
End Sub
I want it to work just like it does in regular Excel - but it always gives me an error message (see the attached picture)
I am enclosing a VERY simple sample macro (see below)
When I run it, I get a "division by zero" instead of "X" becoming a 0
This seems simple, but I cannot figure it out
THANK YOU!
Sub TestIferror()
Dim X As Integer
X = WorksheetFunction.IfError(1 / 0, 0)
End Sub