Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following
Col A Col Q Col Z 746 123 746 4789 746 124 748 8566 748 9586 748 852 I have this for about 3100 lines of data. I need to if Col A is the same the return col B concatenate. So for Trailer # 746 return 123, 4789, 124 in col Z. I did this about 2 years ago and quite frankly I had some help and no longer remember how the macro needs to be written. Please help. Thanks, Wanda |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() iLastRow = Cells(Rows.Count, "A").End(xlUp).Row tmp = Cells(1, "A").Value sNums = Cells(1, "Q").Value For i = 2 To iLastRow If Cells(i, "A").Value = tmp Then sNums = sNums & ", " & Cells(i, "Q").Value Else j = j + 1 Cells(j, "Z").Value = sNums sNums = Cells(i, "Q").Value tmp = Cells(i, "A").Value End If Next i j = j + 1 Cells(j, "Z").Value = sNums -- HTH Bob Phillips (remove nothere from email address if mailing direct) "gwtreece" wrote in message ... I have the following Col A Col Q Col Z 746 123 746 4789 746 124 748 8566 748 9586 748 852 I have this for about 3100 lines of data. I need to if Col A is the same the return col B concatenate. So for Trailer # 746 return 123, 4789, 124 in col Z. I did this about 2 years ago and quite frankly I had some help and no longer remember how the macro needs to be written. Please help. Thanks, Wanda |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bob, I just came across your code for concatenating. It works great. I've
needed this for about a hundred years--gives me the flexibility I couldn't get any other way. Thanks! "Bob Phillips" wrote: iLastRow = Cells(Rows.Count, "A").End(xlUp).Row tmp = Cells(1, "A").Value sNums = Cells(1, "Q").Value For i = 2 To iLastRow If Cells(i, "A").Value = tmp Then sNums = sNums & ", " & Cells(i, "Q").Value Else j = j + 1 Cells(j, "Z").Value = sNums sNums = Cells(i, "Q").Value tmp = Cells(i, "A").Value End If Next i j = j + 1 Cells(j, "Z").Value = sNums -- HTH Bob Phillips (remove nothere from email address if mailing direct) "gwtreece" wrote in message ... I have the following Col A Col Q Col Z 746 123 746 4789 746 124 748 8566 748 9586 748 852 I have this for about 3100 lines of data. I need to if Col A is the same the return col B concatenate. So for Trailer # 746 return 123, 4789, 124 in col Z. I did this about 2 years ago and quite frankly I had some help and no longer remember how the macro needs to be written. Please help. Thanks, Wanda |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
CONCATENATE | Excel Discussion (Misc queries) | |||
I know how to concatenate ,can one de-concatenate to split date? | New Users to Excel | |||
concatenate | Excel Worksheet Functions | |||
Un - Concatenate? | Excel Worksheet Functions | |||
Un - Concatenate ? | Excel Worksheet Functions |