Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi;
I need someone's help urgently. I've few columns of data as follows in my spreadsheet currently: Employee Number Plan Enrolled -------------------- ---------------- 12345678 Benefit Plan 09876543 Benefit Plan 12345678 Social Security Plan Currently, the data is being displayed in 2 rows as above. Please advice whether I could make it to display as follows in stead: Employee Number Plan Enrolled -------------------- ---------------- 12345678 Benefit Plan, Social Security Plan 09876543 Benefit Plan |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
As a result of that, as long as the Employee Number repeats, I want Excel to
merge all the plan enrolled by this employee into 1 row. Please take note that I've hundreds of employees in the spreadsheet now, thus I'm not be able to do this manually. Can anyone please help? "ah" wrote: Hi; I need someone's help urgently. I've few columns of data as follows in my spreadsheet currently: Employee Number Plan Enrolled -------------------- ---------------- 12345678 Benefit Plan 09876543 Benefit Plan 12345678 Social Security Plan Currently, the data is being displayed in 2 rows as above. Please advice whether I could make it to display as follows in stead: Employee Number Plan Enrolled -------------------- ---------------- 12345678 Benefit Plan, Social Security Plan 09876543 Benefit Plan |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You can use this macro against a copy of your worksheet--it destroys the
original while creating the new format. Option Explicit Sub testme() Dim wks As Worksheet Dim LastRow As Long Dim FirstRow As Long Dim iRow As Long Set wks = Worksheets("Sheet1") With wks With .Range("a:b") .Cells.Sort key1:=.Columns(1), order1:=xlAscending, _ header:=xlYes End With FirstRow = 2 LastRow = .Cells(.Rows.Count, "A").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 ah wrote: Hi; I need someone's help urgently. I've few columns of data as follows in my spreadsheet currently: Employee Number Plan Enrolled -------------------- ---------------- 12345678 Benefit Plan 09876543 Benefit Plan 12345678 Social Security Plan Currently, the data is being displayed in 2 rows as above. Please advice whether I could make it to display as follows in stead: Employee Number Plan Enrolled -------------------- ---------------- 12345678 Benefit Plan, Social Security Plan 09876543 Benefit Plan -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Merging multiple columns of data into one column of data | Excel Discussion (Misc queries) | |||
Merging data | Excel Discussion (Misc queries) | |||
merging data | New Users to Excel | |||
Merging Data | Excel Discussion (Misc queries) | |||
Should Merging workbooks pick up new data or only edited data? | Excel Worksheet Functions |