View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_2_] Don Guillett[_2_] is offline
external usenet poster
 
Posts: 1,522
Default Macro for merging rows

Assumes you have sorted first
'=======
Option Explicit
Sub lineemupSAS()
Dim i As Long
Dim lc As Long
For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
If Cells(i - 1, 1) = Cells(i, 1) Then
lc = Cells(i - 1, Columns.Count).End(xlToLeft).Column + 1
Cells(i - 1, lc) = Cells(i, 2)
Cells(i - 1, lc + 1) = Cells(i, 3)
Rows(i).Delete
End If
Next i
End Sub
'=========
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"rsklhm" wrote in message
...
I have a fairly large spreadsheet that are sorted based on a file # (ie:
E0800100, E0800101). The spreadsheet is setup to where each entry is on
an
individual row as seen below:

A B C
E0800100 Review.... 1.0 (hr)
E0800100 Review.... 2.0
E0800101 Review.... 1.5
E0800102 Review.... .5

I am trying to organize the spreadsheet so that there is only one row per
file number and the Descriptions (B) and Time (C) extend along the columns
of
that row.

A. B. C.
D. E.
E0800100 Review.... 1.0
Review..... 2.0
E0900101 Review.... 1.5
E0900102 Review... .5

The spreadsheet is not consistent in that there are 2 or 3 entries for
every
file number but ranges from 1-15 entries. I attempted to combine various
macro formulas I've seen but have had no such luck and am at a loss to if
this is possible. Any information or direction to getting this as close
as
possible would be appreciated.