Set a cell value from a function

后端 未结 4 1209
旧时难觅i
旧时难觅i 2020-11-27 07:27

The contents of cell A1 is =test(2) where test is the function:

Function test(ByRef x As Double) As Double
  Range(\"A         


        
4条回答
  •  一生所求
    2020-11-27 08:06

    Due to Function fundamentals which state that you can not change or set sheet cells. You need to delete the row with Range("A2") = x

    EDIT Some additional link (which I believe is always useful to provide for those who want to analyse UDF topic): Creating custom functions by Microsoft

提交回复
热议问题