So I have two sheets. sheet2 and sheet 1. On sheet 1, I first of all delete duplicates, then I perform a vlookup (on sheet1) to see if any of the records on sheet1 are not on the main sheet. Records on sheet 1 not found on sheet 2 are then appended to sheet2. i want this to be on the row after the end of the last row on sheet2. I am having issues with the appending. please forgive my coding. i hope to get better. i keep getting the error below. Below is my macro
Sub Macro8()
'
' Macro8 Macro
'
Sheets("sheet2").Select
Columns("C:C").Select
Sheets("sheet2").Select
Columns("C:C").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Sheets("sheet1").Select
'
Rows("1:1").Select
Selection.Delete Shift:=xlUp
Cells.Select
ActiveSheet.Range("$A$1:$G$48").RemoveDuplicates Columns:=2, Header:=xlYes
Range("A1").Select
'
'
'
Columns("C:C").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("C2").Select
ActiveCell.Formula2R1C1 = "=if"
Range("C2").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(VLOOKUP(RC[-1],'sheet2'!C[-1],1,FALSE),""Not Found"")"
Range("C2").Select
Selection.AutoFill Destination:=Range("C2:C10")
Range("C2:C10").Select
Cells.Select
Selection.AutoFilter
'
'
Columns("C:C").Select
Selection.Copy
Columns("C:C").Select
ActiveSheet.Range("$A$1:$L$48").AutoFilter Field:=3, Criteria1:="Not Found"
Cells.Select
Selection.Copy
Sheets("sheet2").Select
Range("A2").Select
Selection.End(xlDown).Select
Range("B1").Select
Selection.End(xlDown).Select
'Range("A10").Select
Range("B" & Rows.Count).End(xlUp).Offset(1).Select
ActiveSheet.Paste
Range("G12").Select
Sheets("Sheet1").Select
Range("H63").Select
Sheets("sheet2").Select
Columns("C:C").Select
Selection.Delete Shift:=xlToLeft
End Sub
Sub Macro8()
'
' Macro8 Macro
'
Sheets("sheet2").Select
Columns("C:C").Select
Sheets("sheet2").Select
Columns("C:C").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Sheets("sheet1").Select
'
Rows("1:1").Select
Selection.Delete Shift:=xlUp
Cells.Select
ActiveSheet.Range("$A$1:$G$48").RemoveDuplicates Columns:=2, Header:=xlYes
Range("A1").Select
'
'
'
Columns("C:C").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("C2").Select
ActiveCell.Formula2R1C1 = "=if"
Range("C2").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(VLOOKUP(RC[-1],'sheet2'!C[-1],1,FALSE),""Not Found"")"
Range("C2").Select
Selection.AutoFill Destination:=Range("C2:C10")
Range("C2:C10").Select
Cells.Select
Selection.AutoFilter
'
'
Columns("C:C").Select
Selection.Copy
Columns("C:C").Select
ActiveSheet.Range("$A$1:$L$48").AutoFilter Field:=3, Criteria1:="Not Found"
Cells.Select
Selection.Copy
Sheets("sheet2").Select
Range("A2").Select
Selection.End(xlDown).Select
Range("B1").Select
Selection.End(xlDown).Select
'Range("A10").Select
Range("B" & Rows.Count).End(xlUp).Offset(1).Select
ActiveSheet.Paste
Range("G12").Select
Sheets("Sheet1").Select
Range("H63").Select
Sheets("sheet2").Select
Columns("C:C").Select
Selection.Delete Shift:=xlToLeft
End Sub