Two questions.
1) How can I get the macro to stop at the last row without doing another 10 rows even though maybe there are only 3 rows left at the bottom?
2) Should I put a delay between each loop and what would be the best way to do this?
Code: Select all
Sub Demo()
Dim lRow As Long: lRow = Cells(Rows.Count, 1).End(xlUp).Row
Dim i As Long
For i = 2 To lRow Step 10
With Range("B" & i).Resize(10)
.FormulaR1C1 = "=XLOOKUP(RC[-1],R2C8:R20C8,R2C9:R20C9)"
.Copy
.PasteSpecial Paste:=xlPasteValues
End With
Next i
End Sub