Forum Discussion
Chris_Gross
Microsoft
Dec 03, 2020LAMBDA Examples: Distance between two cities
This post is the first of a series where we will be sharing out examples of lambdas. This is intended to highlight lambdas we have cooked up that show the power of this new super-charged function. Ad...
lori_m
Dec 09, 2020Steel Contributor
Given a named formula MyFunc in Book1, we should be able to call it from another workbook (as with vba functions):
=Book1!MyFunc(123)
If MyFunc =LAMBDA(x,x) this returns an error on my build but I assume it will work soon. Instead we could test with MyFunc = MyVBAFunc where
Function MyVBAFunc(x): MyVBAFunc = x: End Function
To access MyFunc as an add-in function without the Book1! prefix we would need to press Ctrl+F11 to open a macro sheet and change the definition in the define name dialog to a function. Or equivalently from vba:
Names("MyFunc").MacroType=xlFunction
For a simple test define the name MyFunc:=123 as a function and set the workbook IsAddin property to True. This name is then accessible from any workbook.
Sameer_Bhide
Dec 10, 2020Iron Contributor
Wow ! - How did you figure that out - I am going to give this a shot on my install and see how it goes.
Cheers
Sam