View Single Post
 
Old 05-23-2019, 10:17 PM
NoSparks NoSparks is offline Windows 7 64bit Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

Try this on the file you've posted
Code:
Sub CombineData()
    
    Dim i As Long, lr As Long
    Dim rng As Range, cel As Range
    
Application.ScreenUpdating = False
With Sheets("Vendor Report")
    lr = .Range("S" & Rows.Count).End(xlUp).Row
    For i = lr To 3 Step -1
        If .Cells(i, "S") = .Cells(i - 1, "S") Then
            Set rng = .Range(.Cells(i, "F"), .Cells(i, "Q"))
            For Each cel In rng
                If cel.Value <> 0 And cel.Value <> "" Then
                    If cel.Offset(-1) = 0 Or cel.Offset(-1) = "" Then
                        cel.Offset(-1) = cel.Value
                    End If
                End If
            Next cel
            .Rows(i).Delete
        End If
    Next i
End With
Application.ScreenUpdating = True
    
End Sub
Reply With Quote