Forum Discussion

ExcelRobot's avatar
ExcelRobot
Brass Contributor
Apr 09, 2022
Solved

Evaluate Lambda in VBA

Q:  How can I evaluate an expression containing a custom Lambda call in VBA?   I've created a LAMBDA function that returns a column vector array that I would like to be able to evaluate in VBA pass...
  • JKPieterse's avatar
    Apr 11, 2022

    ExcelRobot If I create a very simple lambda:


    ListOfNumbers: =LAMBDA(n,SEQUENCE(n,1,1,1))

     

    and  execute this code:

    Sub foobar()
        Dim v
        v = Evaluate("listofnumbers(10)")
        Stop
    End Sub
    

    and open the locals window, v is an array containing the numbers 1 to 10.

Resources