An alternative if you don't want to use VBA:
Select the column, go to Home
- Find & Select
- Go to Special
- select Blanks
and hit OK
. You have all the blank cells selected. Now enter a formula referencing the cell above the active cell (=
sign and up arrow
) and hit ctrl+enter
to paste it into all the selected cells.
You might want to copy-paste values the whole column afterwards.
On huge ranges, (e.g. more than 100000 cells) this method becomes slow, so I too recommend the VBA solutions on big tables.
A quick benchmark: both ZygD's and D_Bester's solutions ran just under 2 seconds on 130000 rows. If I run them on the same set of cells, there is no measurable speed difference between them. On the other hand, using the specialcells(xlcelltypeblanks) takes 25 seconds just to find the empty cells.