Array

D

Daviv

I trying to mulitply range "TestArray" and "Result" to make array one and
transpose it on C1 to C3. "TestArray" and "Result" has 3 numbers each.

Sub Sheet_Fill_Array()
Dim one As Integer
one = SumProduct("TestArray", "Result")
Range("C1:C3").Value = Application.WorksheetFunction.Transpose(one)

End Sub
 
A

Alan Beban

You don't need code . If "TestArray" and "Result" are vertical ranges
then on the worksheet, array entered into C1:C3

=TestArray*Result

If "TestArray" and "Result" are horizontal ranges then

=TRANSPOSE(TestArray*Result)

Alan Beban
 
D

Daviv

I want to allow "TestArray" and "Result" to change. Instead of adjusting the
formula in column C, I want to write a code where a new array would be
generated and assigned a range on column C that would have the same number of
rolls as "TestArray" and "Result". For example,

In 1 instance, it would be:

TestArray Result New Array
1 1 1
2 2 4

In another instance:

1 2 2
1 3 3
4 2 8

When the rows increase, I don't want to copy and paste the formula.

-- Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top