Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 921
Default Arithmatic operation on arrays

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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
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!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Arithmatic functions with date format...angry results chris23892 via OfficeKB.com Excel Worksheet Functions 7 January 8th 09 07:38 PM
Text Time Coversion Arithmatic ZeroWayCool Excel Discussion (Misc queries) 1 April 2nd 06 02:52 PM
what does $ operation mean JO New Users to Excel 1 December 15th 05 11:42 PM
ilegal operation emilija Links and Linking in Excel 1 January 20th 05 12:24 AM
msg box while operation is running. Tod[_4_] Excel Programming 1 August 28th 04 12:11 AM


All times are GMT +1. The time now is 04:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"