I'm not sure if this is exactly what you want to have done or not, but try putting this formula in cell B8 and then copy down:

=IF(B1="","",B1+1)