Thread: Array
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Daviv Daviv is offline
external usenet poster
 
Posts: 39
Default Array

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!


"Alan Beban" wrote:

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



Daviv wrote:
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