How can I use Excellink functions in a Excel Macro Function instead of a Sub?
Show older comments
I have a Macro Sub that passes in "A" and "b" named ranges to "myfunc" and returns the result to the "x" named range.
Sub Calculate()
MLOpen
MLPutMatrix "A", Range("A")
MLPutMatrix "b", Range("b")
MLEvalString "x = myfunc(A, bl)"
MLGetMatrix "x", "x"
MatlabRequest
End Sub
I can call this in Excel with "=Calculate()" and it populates "x", but now I want to call it like "=Calculate([rangeA], [rangeB])", where rangeA and rangeB can be any Excel range.
How can I do this with Excel Macro functions?
Accepted Answer
More Answers (0)
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!