![]() |
|
#1
|
|||
|
|||
![]()
Thank you for your help NoSparks. The suggested Vba Macro provided the results I was looking for. Below is a small sample of the output. emmorel
1001017255 36415, 82310, 82330, 82784, 82785, 83970, 84436, 84443, 85025, 86359, 86360 36415 82310 82330 82784 82785 83970 84436 84443 85025 86359 86360 1001113575 36415, 83655, 86003 36415 83655 86003 1001148250 36415, 82785, 86003 36415 82785 86003 1001164885 36415, 82785, 86003 36415 82785 86003 1001211245 36415, 86003 36415 86003 |
#2
|
|||
|
|||
![]() Quote:
Are you now saying the new sample output is what you would prefer? If so, try this way Code:
Sub MergeCodes_v2() Dim i As Long, lr As Long Dim rng As Range, cel As Range Dim str As String With Sheets("Sheet1") '<~~ change to actual sheet name lr = .Range("A" & Rows.Count).End(xlUp).Row 'add row for merge string For i = lr To 2 Step -1 If Len(.Cells(i, "A")) = 10 Then .Rows(i + 1).Insert End If Next i 'recalc lastrow lr = .Range("A" & Rows.Count).End(xlUp).Row Set rng = .Range("A2:A" & lr) End With For Each cel In rng cel.Select If cel.Value = "" Then For i = 1 To lr If Len(cel.Offset(i).Value) < 10 And cel.Offset(i).Value <> "" Then str = str & ", " & cel.Offset(i).Value Else cel.Value = Mid(str, 3) cel.Font.Bold = False str = "" Exit For End If Next i End If Next cel End Sub |
#3
|
|||
|
|||
![]() Quote:
|
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Merging 2 different cells containing IF formula & change in cell values based on multiple time frame | jay_excel | Excel | 0 | 07-29-2017 11:04 PM |
![]() |
markharper80 | Excel | 3 | 02-16-2015 04:18 PM |
![]() |
Bartestokles | Word | 5 | 12-29-2010 01:42 PM |
Merging Multiple Copies of the Same Document | bshatto | Word | 0 | 10-19-2009 06:22 AM |
![]() |
George99 | Word | 1 | 12-06-2008 09:59 AM |