Sub Crosscheck()
Application.ScreenUpdating = False
Dim r As Range
Dim ws As Worksheet
Set ws = Worksheets("Reconcile")
Set r = ws.Range("B5", ws.Cells.SpecialCells(xlCellTypeLastCell)).EntireRow.Resize(, 1).Offset(, 1)
r.FormulaR1C1 = "=IF(ISNA(VLOOKUP(RC[-1],System!C:C,1,FALSE)),"""",VLOOKUP(RC[-1],System!C:C,1,FALSE))"
r.Offset(, 1).FormulaR1C1 = "=IF(ISNA(VLOOKUP(RC[-2],System!C[-1]:C,2,FALSE)),"""",VLOOKUP(RC[-2],System!C[-1]:C,2,FALSE))"
r.Resize(, 2).Copy
Application.DisplayAlerts = False
r.Resize(, 2).PasteSpecial xlPasteValues
Application.CutCopyMode = False
Set r = ws.Range("B5", ws.Cells.SpecialCells(xlCellTypeLastCell)).EntireRow.Resize(, 1).Offset(, 1)
r.EntireRow.RowHeight = 15
r.Resize(, 1).Offset(, -1).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
|