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: 7
Default Adding Rabges without for each loops

Hi,

I should like to add the cells in two ranges WITHOUT having to loop through
each range separately.
Suppose the cells A1 to A5 in my worksheet are filled, as well as cells B1 to
B5

Now I thought this would do the trick. But apparently not:
Sub AddRanges()
Dim r1 As Range
Dim r2 As Range
Dim r3 As Range

Set r1 = Range("a1:a5")
Set r2 = Range("b1:b5")
Set r3 = Range("c1:c5")

r3.value = r1.value + r2.value
End Sub

Any suggestions?

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200703/1

 
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
Loops fugfug[_2_] Excel Programming 3 July 8th 05 10:53 AM
Loops Snow[_2_] Excel Programming 2 May 13th 04 09:48 PM
Loops etc. Jonathan Vickers Excel Programming 6 February 28th 04 05:35 PM
help with loops Rick B[_6_] Excel Programming 8 January 28th 04 12:32 AM
LOOPS Fernando Duran Excel Programming 2 September 3rd 03 01:07 AM


All times are GMT +1. The time now is 08:03 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"