hitch_hiker
Active Member
- Joined
- Feb 21, 2012
- Messages
- 294
The loop I have just written seems to only for the first 9 cells, obviously I did it wrong
the range starts at e9, though there is no data in e1:e8, so there is no reason why I can't start the range at e1, if it will make matters work
this is my second loop ( the first one didn't work so I just changed every cell ), but in this case I have an expanding list, so I have no choice but to do it as a loop
Code:
Dim RS As Worksheet
Dim LastRow As Long
rl = 9
Set RS = Sheets("product list")
'there is code here which works and has no bearing the problem
With RS
' Range("e1:e").Select
LastRow = .Cells(.Rows.Count, 1).End(xlUp).Row
For Each cell In .Range("e9:e" & LastRow)
If Range("e" & rl) <> 3 Then Range("o" & rl) = 1
rl = rl + 1
Next cell
End With
this is my second loop ( the first one didn't work so I just changed every cell ), but in this case I have an expanding list, so I have no choice but to do it as a loop