0

I'm trying to put a user defined function in cell J3 through Range.Formula method, but I encounter application-defined or object-defined error, can someone please tell me if it is even possible to put UDFs in cells that way? I tested the function by inputing it manually and it works. The code is:

Range("J3").Formula = "=EmpiricalDist($AF$1;$AD$1;0.95;E3;1;-1)"

where EmpiricalDist is the mentioned UDF. I'm working in excel 2013.

Community
  • 1
  • 1

1 Answers1

0

I had the same problem.

Chang line

Range("J3").Formula = "=EmpiricalDist($AF$1;$AD$1;0.95;E3;1;-1)"

Into

Use Range("J3").FormulaLocal = "=EmpiricalDist($AF$1;$AD$1;0.95;E3;1;-1)"
Gerrit-Jan
  • 59
  • 1
  • 9