Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to concatenate rows of a large excel file. This type of data I
recieve every week and need help finding a macro that would fix my files. I am a baby when it comes programming ;) What I have: Name Description a r a s b t b u c v c w What I need: Name Description a r, s b t, u c v, w I would really appreciate any help, DD |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If your data is already sorted by column A:
Option Explicit Sub testme() Dim LastRow As Long Dim FirstRow As Long Dim iRow As Long Dim wks As Worksheet Set wks = Worksheets("sheet1") With wks FirstRow = 2 'headers in row 1?? LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row For iRow = LastRow To FirstRow + 1 Step -1 If .Cells(iRow, "A").Value = .Cells(iRow - 1, "A").Value Then .Cells(iRow - 1, "B").Value _ = .Cells(iRow - 1, "B").Value & ", " & .Cells(iRow, "B").Value .Rows(iRow).Delete End If Next iRow End With End Sub If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm DD wrote: I need to concatenate rows of a large excel file. This type of data I recieve every week and need help finding a macro that would fix my files. I am a baby when it comes programming ;) What I have: Name Description a r a s b t b u c v c w What I need: Name Description a r, s b t, u c v, w I would really appreciate any help, DD -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you! I'll give this a try...
DD |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Concatenate 2 rows | Excel Discussion (Misc queries) | |||
Concatenate Multiple Rows | Excel Discussion (Misc queries) | |||
How to concatenate many rows in Excel | Excel Worksheet Functions | |||
Concatenate several rows | Excel Worksheet Functions | |||
Concatenate many rows quickly | Excel Worksheet Functions |