#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Simple Loop

I have data in I4:I18. If the value is greater than zero I would like to
check if the value in V & activerow (ex: V4) is greater than I & activerow.
If so, do command and keep checking the remaining rows.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Simple Loop

John,

Try this

Sub sonic()
For Each c In Range("I4:I18")
If IsNumeric(c.Value) And c.Value 0 And c.Value c.Offset(, 13).Value
Then
'Do something"
End If
Next
End Sub

Mike

"John" wrote:

I have data in I4:I18. If the value is greater than zero I would like to
check if the value in V & activerow (ex: V4) is greater than I & activerow.
If so, do command and keep checking the remaining rows.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Simple Loop

Try

Sub Macro()
For Each c In Range("I4:I18").Rows
If Range("V" & c.Row) <= c.Value Then
'Do somthing. Number in V less than I
End If
Next
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"John" wrote:

I have data in I4:I18. If the value is greater than zero I would like to
check if the value in V & activerow (ex: V4) is greater than I & activerow.
If so, do command and keep checking the remaining rows.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Simple Loop

I am getting the command run (the do something part) run 16 times... How do I
check that row once and then move to the next row?

"Jacob Skaria" wrote:

Try

Sub Macro()
For Each c In Range("I4:I18").Rows
If Range("V" & c.Row) <= c.Value Then
'Do somthing. Number in V less than I
End If
Next
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"John" wrote:

I have data in I4:I18. If the value is greater than zero I would like to
check if the value in V & activerow (ex: V4) is greater than I & activerow.
If so, do command and keep checking the remaining rows.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Simple Loop

nevermind got it...

"John" wrote:

I am getting the command run (the do something part) run 16 times... How do I
check that row once and then move to the next row?

"Jacob Skaria" wrote:

Try

Sub Macro()
For Each c In Range("I4:I18").Rows
If Range("V" & c.Row) <= c.Value Then
'Do somthing. Number in V less than I
End If
Next
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"John" wrote:

I have data in I4:I18. If the value is greater than zero I would like to
check if the value in V & activerow (ex: V4) is greater than I & activerow.
If so, do command and keep checking the remaining rows.

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
Simple Loop Help Please pianoman[_24_] Excel Programming 0 May 24th 06 02:34 PM
Simple Loop Help Please HBF Excel Programming 0 May 24th 06 02:30 PM
Simple loop? bushtor Excel Programming 3 September 13th 05 01:45 PM
Simple question on For...Next loop Alex Excel Programming 1 July 26th 05 03:30 PM
Some help w/ simple loop, please? terry b Excel Programming 6 February 6th 05 06:17 PM


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