Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
tgoosed
 
Posts: n/a
Default combining row information


I'm having an issue with an easy way to combine row information. Below
is an example of the both the data and what I would like as an end
result. The spreadsheet I have contains over 37000 lines.

column a column b column c column d

1234 glove ea 04661
1234 glove ea 01661
1234 glove ea 06661
1235 mask ea 04661
1235 mask ea 01661

The output I would like would be
column a column b column c column d column e column f

1234 glove ea 04661 01661
06661
1235 mask ea 04661 01661


--
tgoosed
------------------------------------------------------------------------
tgoosed's Profile: http://www.excelforum.com/member.php...o&userid=28088
View this thread: http://www.excelforum.com/showthread...hreadid=475929

  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Here's a macro to do it

Sub Test()
Dim iLastRow As Long
Dim i As Long
Dim rng As Range

iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = iLastRow To 2 Step -1
If Cells(i, "A").Value = Cells(i - 1, "A").Value Then
Cells(i, "D").Resize(, 252).Copy Cells(i - 1, "E")
If rng Is Nothing Then
Set rng = Rows(i)
Else
Set rng = Union(rng, Rows(i))
End If
End If
Next i

If Not rng Is Nothing Then rng.Delete

End Sub

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"tgoosed" wrote in
message ...

I'm having an issue with an easy way to combine row information. Below
is an example of the both the data and what I would like as an end
result. The spreadsheet I have contains over 37000 lines.

column a column b column c column d

1234 glove ea 04661
1234 glove ea 01661
1234 glove ea 06661
1235 mask ea 04661
1235 mask ea 01661

The output I would like would be
column a column b column c column d column e column f

1234 glove ea 04661 01661
06661
1235 mask ea 04661 01661


--
tgoosed
------------------------------------------------------------------------
tgoosed's Profile:

http://www.excelforum.com/member.php...o&userid=28088
View this thread: http://www.excelforum.com/showthread...hreadid=475929



  #3   Report Post  
tgoosed
 
Posts: n/a
Default


Bob,

Thank you!!! That worked perfectly and save me hours of work.


--
tgoosed
------------------------------------------------------------------------
tgoosed's Profile: http://www.excelforum.com/member.php...o&userid=28088
View this thread: http://www.excelforum.com/showthread...hreadid=475929

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Illinois Personal Information Protection Act [email protected] Excel Worksheet Functions 0 August 16th 05 03:15 AM
Combining cell information Ann-Charlotte Excel Worksheet Functions 1 August 3rd 05 01:25 PM
Update a spreadsheet with new information. a6kim Excel Discussion (Misc queries) 1 May 2nd 05 11:56 AM
Clearing information in certain columns jolly_lolly Excel Discussion (Misc queries) 1 April 22nd 05 02:41 AM
Combining Information in a Bar Chart B. Scace Charts and Charting in Excel 4 January 13th 05 08:55 PM


All times are GMT +1. The time now is 11:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"