View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Automate this code

do you want to do all three comparisons in the if statement or do you want
to do one of them for each pass through the loop, incrementing as you loop.
(if so, why only 3 ranges when the loop loops 5 times?)

--
Regards,
Tom Ogilvy

"hotherps " wrote in message
...
I have the following code:
For Each cell In Range("G11:O125")
c = Array(11, 10, 9, 8, 7)
For i = 0 To 4
If Cells(356, c(i)).Value = Cells(305, c(i)) And cell.Value "" And
Cells(cell.Row, c(i) + 97) = "x" Then _
cell.Value = Cells(9, c(i) + 97)
Next i
Next

On the If statement I need to offset one cell down in both ranges about
50 rows. i.e. 357,358 : 306,307 etc.

As opposed to doing this:

If Cells(356, c(i)).Value = Cells(305, c(i)) And cell.Value
If Cells(357, c(i)).Value = Cells(306, c(i)) And cell.Value
If Cells(358, c(i)).Value = Cells(307, c(i)) And cell.Value
Thanks


---
Message posted from http://www.ExcelForum.com/