View Single Post
 
Old 06-05-2019, 07:41 AM
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

Give this a shot
Code:
Sub CombineData_v3()
    
    Dim i As Long, lr As Long, helpCol As Long
    Dim firstFcst As Long
    
With Sheets("Vendor Report")
    lr = .Range("S" & Rows.Count).End(xlUp).Row
    firstFcst = .Cells(1, .Columns.Count).End(xlToLeft).Column
    helpCol = 30    'AD
    For i = lr To 3 Step -1
        If .Cells(i, helpCol) = "A" And .Cells(i, "S") = .Cells(i - 1, "S") Then
            .Cells(i - 1, "F").Resize(, firstFcst - 6).Value = .Cells(i, "F").Resize(, firstFcst - 6).Value
            .Rows(i).Delete
        End If
    Next i
End With
End Sub
Reply With Quote