Looking again at your request, the previous code is not what you wanted.
This code should be closer to what you want I think.
Sub Count_Tanks_B()
Dim lr As Long, c As Range, a As Long
Application.ScreenUpdating = False
lr = Cells(Rows.Count, 1).End(xlUp).Row
For Each c In Range("A2:A" & lr)
If c.Value <> c.Offset(1).Value Then
a = Cells(c.Row, 2).End(xlUp).Row
Range(Cells(c.Row, 2), Cells(c.Row, 2).End(xlUp).Offset(1)).Value = c.Row - a
Else
End If
Next c
Application.ScreenUpdating = True
End Sub