LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default How can I sum two arrays together?

Hi all, I'm using Excel 2003.

Is there a way to quickly sum two arrays together in VBA, so that

Array3(r,c)=Array1(r,c)+Array2(r,c) ?

where r = row number, c = column number, Array1 and Array2 are the
input arrays and Array3 is the output of the calculation

I searched this and other forums, and tried several things, but the
only solution I found was to write a function which loops through all
the items one by one. It works, but it's pretty slow and I was hoping
for a faster solution, as I have to run this on a rather large file.

In Matlab and other environments it's as easy as writing

Array3 = Array1 + Array2

Is there really no equivalent in VBA? :(

Thanks!
 
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
Trouble with arrays (transferring values between two arrays) Keith R[_2_] Excel Programming 4 November 14th 07 12:00 AM
Use of arrays DKS Excel Worksheet Functions 0 November 30th 06 04:11 PM
Working with ranges in arrays... or an introduction to arrays Glen Excel Programming 5 September 10th 06 08:32 AM
Arrays - declaration, adding values to arrays and calculation Maxi[_2_] Excel Programming 1 August 17th 06 04:13 PM
Arrays Ken Rock Excel Programming 3 November 17th 05 11:42 AM


All times are GMT +1. The time now is 11:11 AM.

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"