# [SOLVED] VBA Code Excel - Copy Paste Into Blank Lines



## DChodos (Sep 6, 2007)

Can someone please help me with some VBA Code?

I have a spreadsheet that has a bunch of lines with data and then a number of blank lines below it, until it reaches the next line of data. This goes on for about 10,000 rows. See below for for example:

1)AAA BBB CCC DDD
2)
3)
4)WWW EEE 888 4455 
5)
6)QQQQ KKK UUU 6555 
7)
8)ZZZ YYY CCC EEEE
9)
10)
11)

I'm looking for VBA code that will help me copy the line and paste the values of that line into the next blank lines, so the example would then look like this:

1)AAA BBB CCC DDD
2)AAA BBB CCC DDD
3)AAA BBB CCC DDD
4)WWW EEE 888 4455 
5)WWW EEE 888 4455 
6)QQQQ KKK UUU 6555 
7)QQQQ KKK UUU 6555 
8)ZZZ YYY CCC EEEE
9)ZZZ YYY CCC EEEE
10)ZZZ YYY CCC EEEE
11)ZZZ YYY CCC EEEE


Any ideas?

Thanks


----------



## Glaswegian (Sep 16, 2005)

*Re: VBA Code Excel - Copy Paste Into Blank Lines*

Hi and welcome to TSF.

No need for a macro. To fill in the missing data, highlight the required range of cells. Now press Ctrl+G - this will bring up the 'GoTo' dialogue box. Click on the 'Special' button and then click on 'Blanks'. Click 'OK'. Now type an = sign, press the Up Arrow key then Ctrl+Enter. This will fill in all the blank cells with the same data as the cell above.


----------



## DChodos (Sep 6, 2007)

*Re: VBA Code Excel - Copy Paste Into Blank Lines*

Thanks! Perfect.


----------

