This seems to work:
[vba]
Dim x As Integer
x = Cells(Rows.Count, "A").End(xlUp).Row + 1
Range("K1").Value = x
With wstSNBD
i = sSNBDi + 1
ii = Range("K1").Value
tSNBDi = tSNBDi + 1
For i = i To ii
[/vba]