Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default loop variable range

I misread the question...

Dim rng As Range

For Each rng In Range("D1:S1")
If rng.Offset(2, 0).value + rng.Offset(4, 0).value rng.Value Then
MsgBox rng.Address
End If
Next rng

--
HTH...

Jim Thomlinson


"Jim Thomlinson" wrote:

One way...

Dim rng As Range

For Each rng In Range("D1:S1")
If Application.Sum(rng.Offset(2, 0).Resize(3, 1)) rng.Value Then
MsgBox rng.Address
End If
Next rng
--
HTH...

Jim Thomlinson


"CR" wrote:

I have a Range with values D1:S5

I need to sum D3 and D5 and if it is D1 value then
Do something

Then loop through E to S, doing the same thing

Any help would be appreciated

Thanks
CR



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
loop variable range Jim Thomlinson Excel Programming 0 September 21st 09 04:27 PM
loop variable range Dave Peterson Excel Programming 0 September 21st 09 04:24 PM
Referencing variable Range in a loop Samirkc Excel Programming 2 July 14th 06 12:49 PM
How to reference variable range in a loop Samirkc Excel Programming 0 July 13th 06 04:11 PM
Setting a range within a loop variable for copy/paste Craig[_24_] Excel Programming 3 December 21st 05 04:05 PM


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