I'm looking to combine multiple rows into a single row based on a value in the code column.. I've noticed other questions on here similiar to my question but I cannot seem to extend the range..
Code Name Value A Value B Value C Value D Value E 101 Example # 101 Example 101 Example # 101 Example # 101 Example # 102 Example2 # 102 Example2 # 102 Example2 # 102 Example2 # 102 Example2 #
So the final result looks like this:
Code Name Value A Value B Value C Value D Value E 101 Example # # # # 102 Example2 # # # # #
This is what I've got so far, my plan was to shift the items to the row above before deleting the entire row as one row may have many items.
Dim RowNum, LastRow, Col As Long RowNum = 2 Col = 3 LastRow = Cells.SpecialCells(xlCellTypeLastCell).row Range("A2", Cells(LastRow, 7)).Select For Each row In Selection With Cells If Cells(RowNum, 1) = Cells(RowNum + 1, 1) Then For Each Cell In row If Cell > 0 Then Cells(RowNum + 1, Col).Copy Destination:=Cells(RowNum, Col) Else Col = Col + 1 End If Rows(RowNum + 1).EntireRow.Delete End If End With RowNum = RowNum + 1 Next row