1

I am moving a excel VBA from PC to Mac and one line has an Evaluate function, for example:

Public Function test()

    test = Evaluate("=2+2")

End Function

However, if I try and run the macro on the mac the function returns #name. Is there an equivalent function on the Mac side to Evaluate?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
pdoak
  • 721
  • 8
  • 21

1 Answers1

2

There is nothing wrong with the above function.

If you are calling the above function in VBA then it works as expected and If you are using it as a UDF i.e you are calling it from the worksheet then #Name error means that you have not pasted the function in a module. Move the function from the Sheet/Workbook code area into a module and then try again.

enter image description here

Siddharth Rout
  • 147,039
  • 17
  • 206
  • 250