Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default 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
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
Error with a For loop with arrays baldomero Excel Programming 8 August 22nd 05 06:24 PM
Worksheet names to variant arrays Alasdair Stirling[_3_] Excel Programming 3 August 3rd 05 01:48 PM
reference 2 arrays in a For Loop Bruce Excel Programming 1 June 10th 05 08:45 AM
Passing variant arrays to C/C++ dll's agarwaldvk[_35_] Excel Programming 0 October 18th 04 01:33 AM
Excel - DotNet - Variant Arrays as Params Paul S Bryant Excel Programming 7 December 3rd 03 11:18 AM


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

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"