R
ryguy7272
I'm stuck on a simple little loop late on a Friday night:
Dim redRng As Range
Dim longrow As Long
longrow = Cells(Rows.Count, "I").End(xlUp).Row
Set redRng = Range("I4", Range("I" & longrow).End(xlUp))
For Each cell In redRng
If cell.Value <> "" Then
ActiveCell.Offset(0, 1).Select
ActiveCell.FormulaR1C1 = "=RC[-6]*RC[-7]"
ActiveCell.Offset(1, -1).Select
End If
Next cell
My loop seems to run four times and then quits. I guess it comes from the
I4, but I'm not sure why it's doing that. Is there a better, clearer, way to
do this?
Thanks,
Ryan--
Dim redRng As Range
Dim longrow As Long
longrow = Cells(Rows.Count, "I").End(xlUp).Row
Set redRng = Range("I4", Range("I" & longrow).End(xlUp))
For Each cell In redRng
If cell.Value <> "" Then
ActiveCell.Offset(0, 1).Select
ActiveCell.FormulaR1C1 = "=RC[-6]*RC[-7]"
ActiveCell.Offset(1, -1).Select
End If
Next cell
My loop seems to run four times and then quits. I guess it comes from the
I4, but I'm not sure why it's doing that. Is there a better, clearer, way to
do this?
Thanks,
Ryan--