Simple Loop

  • Thread starter Thread starter John
  • Start date Start date
J

John

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.
 
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
 
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
 
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top