fill down multiple cells in the same column

J

Jerome

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
 
T

Tom Ogilvy

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.
 
B

Bernie Deitrick

Tom/Jerome,

Perhaps more flexible is:

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

rather than

rng2.Formula = "=A1"

HTH,
Bernie
MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top