Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add variant arrays (without loop)
How to add variant arrays in one-step { without any loop }
'---- Dim arr1() Dim arr2() Dim Result() Redim arr1(1 to 10, 1 to 1) Redim arr2(1 to 10, 1 to 1) Redim Result(1 to 10, 1 to 1) arr1 = Range ("A1:A10") arr2 = Range("B1:B10") Result = arr1 + arr2 ' To add Result (x) = arr1(x) + arr2(x) x=1 to 10, without a loop ? Range("C1:C10").Value2 = Result |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add variant arrays (without loop)
One way:
With Range("C1:C10") .Formula = "=A1+B1" .Value = .Value End With In article , Bharath Rajamani wrote: How to add variant arrays in one-step { without any loop } '---- Dim arr1() Dim arr2() Dim Result() Redim arr1(1 to 10, 1 to 1) Redim arr2(1 to 10, 1 to 1) Redim Result(1 to 10, 1 to 1) arr1 = Range ("A1:A10") arr2 = Range("B1:B10") Result = arr1 + arr2 ' To add Result (x) = arr1(x) + arr2(x) x=1 to 10, without a loop ? Range("C1:C10").Value2 = Result |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Error with a For loop with arrays | Excel Programming | |||
Worksheet names to variant arrays | Excel Programming | |||
reference 2 arrays in a For Loop | Excel Programming | |||
Passing variant arrays to C/C++ dll's | Excel Programming | |||
Excel - DotNet - Variant Arrays as Params | Excel Programming |