View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Arithmatic operation on arrays

Hi Jeff,

I think that it would be necessary to loop through the two arrays, e.g.:

ArrA = ActiveSheet.Range("A1:A100").Value
ArrB = ActiveSheet.Range("B1:B100").Value

ReDim ArrC(1 To 100)

For iCtr = 1 To 100
ArrC(i) = ArrA(iCtr, 1) + ArrB(iCtr, 1)
Next i

Range("C1").Resize(100) = Application.Transpose(ArrC)


---
Regards,
Norman



"Jeff" wrote in message
...
This one has to have been asked before,

I have two arrays

AAA(100), BBB(100) filled with 100 numbers,

How do I add each element in each array to each other

AAA(100) = AAA(100)+BBB(100)
so
AAA(100) = a1+b1, a2+b2, ..., a100+b100


Thanks for your help!