ArviLaanemets answers is the simplest way and should work well, but if you do have any gaps in columns it will stop there, so as a workaround you can go to the last cell then in column b input (where 24000 is the cell you are in)
=ROW(B24000)
then copy the cell (ctrl + c) and press ctrl+shift+arrow up to select all cells above the active cell then ctrl +v to paste
|