Exported data to Excel 2007 has spaces between rows

T

Tony O

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
example,

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
DEF
GHI
1001 ABC
DEF
1002 ABC
DEF

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

Claus Busch

Hi Tony,

Am Sat, 11 Aug 2012 14:11:46 -0700 (PDT) schrieb Tony O:
When the system has the same group number repeat, it only shows up one
time, for example:
Group account
1000 ABC
DEF
GHI
1001 ABC
DEF
1002 ABC
DEF

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?

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)
Next
End Sub


Regards
Claus Busch
 

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