ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   filling an aray without looping (https://www.excelbanter.com/excel-programming/331342-filling-aray-without-looping.html)

[email protected]

filling an aray without looping
 
Is it possible to simply fill it by using an array formula without
looping
to fill it in the same way as you can fill a range with an array such
as:

Range("C1:E20).FormulaArray =
Application.WorksheetFunction.MMult(InvVCVRange, AlphaRange)


By (after rediming it) saying: Array (3,20) =
Application.WorksheetFunction.MMult(Range1, Range2)

Thks, Mark


JE McGimpsey

filling an aray without looping
 
You can assign the result of MMult to a variant:

Dim vArray As Variant
Dim i As Long
Dim j As Long

vArray = Application.MMult(Range("A1:A10"), Range("B1:K1"))

For i = 1 To UBound(vArray, 1)
For j = 1 To UBound(vArray, 2)
Debug.Print "vArray(" & i & "," & j & "): " & vArray(i, j)
Next j
Next i



In article .com,
wrote:

Is it possible to simply fill it by using an array formula without
looping
to fill it in the same way as you can fill a range with an array such
as:

Range("C1:E20).FormulaArray =
Application.WorksheetFunction.MMult(InvVCVRange, AlphaRange)


By (after rediming it) saying: Array (3,20) =
Application.WorksheetFunction.MMult(Range1, Range2)

Thks, Mark



All times are GMT +1. The time now is 10:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com