fill down multiple cells in the same column

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Good day,

Could someone please help me with the following. I want to fill down
multiple cell contents within the same columns. There are over 12000 rows and
the columns vary from 2 or more:

A B
1 abc 123
2
3
4
5 def
6
7
8 ghi
9
10
11 jkl
12
13
14
15 mno
16
17
18
19 pqr

Thank you and best regards,

Jerome
 
Assume the first row of the column will always contain a value

The basic approach would be:
Sub Fillspaces()
Dim rng as Range, rng2 as Range
set rng = Range("A1:B13000")
set rng2 = rng.specialcells(xlBlanks)
rng2.Formula = "=A1"
rng.Formula = rng.Value
End Sub

obviously test this on a copy of your data.
 
Tom/Jerome,

Perhaps more flexible is:

rng2.FormulaR1C1 = "=R[-1]C"

rather than

rng2.Formula = "=A1"

HTH,
Bernie
MS Excel MVP
 
Back
Top