Not to throw a monkey wrench in this whole thread, but I re-read your first attached example.
This code will look for matching account numbers (first 6 numbers) then adds that number to the row above in the pricing column,
then removes the duplicate and moves to next, going from bottom up...
Sorry I didnt pursue this earlier.
Sub combineShops() Dim x, lr As Long lr = Cells(Rows.Count, 1).End(xlUp).Row For x = lr To 2 Step -1 If Left(Cells(x, 2), 6) = Left(Cells(x - 1, 2), 6) Then Select Case Cells(x, "J").Value Case "0000" Cells(x - 1, "F").Value = Cells(x, 2).Value Case "0004" Cells(x - 1, "G").Value = Cells(x, 2).Value Case "5001" Cells(x - 1, "H").Value = Cells(x, 2).Value End Select Cells(x, 2).EntireRow.Delete End If Next x End Sub




Reply With Quote