Windows 7 - Exported data to Excel 2007 has spaces between rows

Asked By Tony O on 11-Aug-12 05:11 PM
I am copying  and pasting from one Excel 2007 spreadsheet to another.

The starting spreadsheet is a pivot table.  There are many things
going on in the background
(I did not create original Excel spreadsheet).

Each row has a group name.  For example, group 1000 is the first
group, 1001 is the second, etc.
Each group should show up may times from one row to the next.  For

Group account
1000   ABC
1000   DEF
1000   GHI
1001   ABC
1001   DEF
1002   ABC
1002   DEF

When the system has the same group number repeat, it only shows up one
time, for example:
Group account
1000   ABC
1001   ABC
1002   ABC

Is there a way to get the account to automatically fill in with the
cell above when it is blank for the
current cell, so it looks like the first output above, where all the
group numbers are filled in correctly?

There are hundreds of group/account combinations and an easier way
that doing this manually will be a
big help.

Please let me know.

Claus Busch replied to Tony O on 11-Aug-12 05:18 PM
Hi Tony,

Am Sat, 11 Aug 2012 14:11:46 -0700 (PDT) schrieb Tony O:

your group numbers in column A, then

Sub FillValues()
Dim R As Range
For Each R In Range("A2", Range("A" & Rows.Count).End(xlUp))
If IsEmpty(R) Then R = R.Offset(-1)
End Sub

Claus Busch
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2