This is an example of my situation.

I have a file with 100,000 rows and I must label the first 2000 with 1 the second 3000 with 2 and so on until the last batch with 50.

In reality, the file doesn’t have 100,000 but is a multiple of the batch of rows to get repeated that is 3190.

A piece of code to start with is as follow:

```
Sub B()
Dim i As Long
Dim q As Integer
For i = 1 To 169070 Step 3190
Cells(i, 1).Value = i + 1
Next i
End Sub
```

Try

```
=FLOOR(ROW()/1000,1)+1
```

Just add to “Row()” the number of rows above your starting point.

Tags: excelexcel, loops, oop