Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Scalar Multiplying VBA Array
I have a VBA function which returns a Variant(). This function is
called as an array formula within Excel. Within the function VBA assigns an array to the function return value. Somewhere in there I'd like to be able scalar multiply the array without having to manually loop through each element. Here's sample code illustrating what I'd *like* to be able do: Public Function MyReturnArrayFunction() as Variant() myRawProbs = Array(7, 9, 3) ' do more stuff here MyReturnArrayFunction = Application.Transpose(myRawProbs)/19 ' This does not work! End Function I do realize I could simply loop through thr array and divide through by the constant, but ostensibly when the VBA array is assigned to the Excel range it's already looping through each element anyway -- so why should I have to do that twice? Thanks in advance, Jacob |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
multiplying | Excel Worksheet Functions | |||
Multiplying | Excel Worksheet Functions | |||
Multiplying Contiguous Values in an Array | Excel Worksheet Functions | |||
Array formula and multiplying conditions | Excel Worksheet Functions | |||
Multiplying in a row | Excel Discussion (Misc queries) |