I have this code which works perfect to export "New" records to my running data workbook but I wanted to add a check that if the record key in column A already exist AND if column B is a match for status as well then do not add that row of data
Code:
Sub UpdateRun() Application.ScreenUpdating = False
Call Dec
Call UnhideAll
If Ws.Range("E3") > 0 Then
Set Wbk = Workbooks.Open(Fl.Range("B9").Value)
Set Nws = Wbk.Sheets("Data")
Set RDPiv = Wbk.Sheets("Pivot")
'---------------------Add records marked as New before matching-------------------------
With TT.DataBodyRange
.AutoFilter 2, "New"
If TT.AutoFilter.Range.Columns(1).SpecialCells(xlCellTypeVisible).Count > 1 Then
'---------------Copy and Paste Data to file---------------------------------------
TT.DataBodyRange.SpecialCells(xlVisible).Copy
Nws.Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial xlPasteValues
Wbk.RefreshAll
TT.AutoFilter.ShowAllData
Wb.RefreshAll
End If
End With
End Sub