View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett[_2_] Don Guillett[_2_] is offline
external usenet poster
 
Posts: 1,522
Default Text Columns Function

Try

Option Explicit

Sub putononelinepereach() 'assumes NO HEADER row
Dim lr As Long
Dim i As Long
Dim slc As Long
Dim dlc As Long
lr = Application.RoundUp(Cells(Rows.Count, 1) _
.End(xlUp).Row / 2, 0) * 2

For i = lr To 2 Step -2
slc = Cells(i, Columns.Count).End(xlToLeft).Column
dlc = Cells(i - 1, Columns.Count).End(xlToLeft).Column + 1
Cells(i, 1).Resize(, slc).Copy Cells(i - 1, dlc)
Rows(i).Delete
Next i
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"KKD" wrote in message
...
The data I am bringing in to Excel comes in two rows for a single record.
I
need to reformat it so that all of the data is on one line. As there are
several thousand records, I need to do find a way to automate this.

Any suggestions?
--
KKD