You can use Excel's notation for an array constant/literal, and pass it to the Evaluate method of the Application before passing it to your function...
VBA Code:
? fn_sum(application.evaluate("{1,2,3;4,5,6}"))
Alternatively, you can use the [ ] shortcut for the Evaluate method...
VBA Code:
? fn_sum([{1,2,3;4,5,6}])
Note that a comma delineates a column, and a semi-colon delineates a row.
Also, unlike the Array function, the indexing for the 2-dimensional array starts at 1, not 0.
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.