#1   Report Post  
Jeff
 
Posts: n/a
Default vba adding arrays

Hi

I am working with a lot of arrays, and I want to be sure that I am coding
most efficiently. I have to add multiply and divide arrays, so for example I
want to take
Array1(100) +5*Array2(100), but it doesnt look like I can just say

Array3(100)=Array1(100) +5*Array2(100)
I have to code

For i = 1 to 100
Array3(i)=Array1(i)+Array2(i)*5
Next i

Is that how you deal with arrays, by using For loops?

Thanks for your help
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default vba adding arrays

Yes, there is no array operators in VBA that I am aware of. You could dump
them to a worksheet range, create a formula to do it, then copy the result
back in, but for 100 elements, hardly worth the bother.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Jeff" wrote in message
...
Hi

I am working with a lot of arrays, and I want to be sure that I am coding
most efficiently. I have to add multiply and divide arrays, so for

example I
want to take
Array1(100) +5*Array2(100), but it doesnt look like I can just say

Array3(100)=Array1(100) +5*Array2(100)
I have to code

For i = 1 to 100
Array3(i)=Array1(i)+Array2(i)*5
Next i

Is that how you deal with arrays, by using For loops?

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
3D Arrays DB Excel Worksheet Functions 2 October 10th 05 03:50 PM
Two arrays need highlight duplicate in one of the array Luke Excel Worksheet Functions 4 July 25th 05 08:41 PM
Confused about arrays and ranges in functions Llurker Excel Worksheet Functions 0 July 7th 05 05:44 AM
problem adding rvnwdr Excel Discussion (Misc queries) 2 June 8th 05 06:36 PM
Comparing Arrays TangentMemory Excel Discussion (Misc queries) 2 May 13th 05 05:06 PM


All times are GMT +1. The time now is 09:02 PM.

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

About Us

"It's about Microsoft Excel"