I'm trying to create a Match macro that compares two lists and gives me the cells that present in only one of the lists. The cells are then copied to another sheet where the cells are counted. However, the blank cells are also being copied and I don't know why. The below is what I have:
Sub Macro_do_Match()
Dim CopyrangeB As String
Dim lRowB As Integer
Dim fRowB As Integer
Dim CopyrangeD As String
Dim lRowD As Integer
Dim fRowD As Integer
Dim rng As Range
' Defines range for column B
lRowB = Cells(Rows.Count, 1).End(xlUp).Row
fRowB = 2
Let CopyrangeB = "B" & fRowB & ":" & "B" & lRowB
' "macro"
Range("B2").Select
ActiveCell.FormulaR1C1 = _
"=IF(NOT(ISERROR(MATCH(C[-1],C[1],0)))=FALSE,C[-1], """")"
Range("B2").Select
Selection.AutoFill Destination:=Range(CopyrangeB)
' Defines range for column D
lRowD = Cells(Rows.Count, 3).End(xlUp).Row
fRowD = 2
Let CopyrangeD = "D" & fRowD & ":" & "D" & lRowD
' "macro"
Range("D2").Select
ActiveCell.FormulaR1C1 = _
"=IF(NOT(ISERROR(MATCH(C[-1],C[-3],0)))=FALSE,C[-1], """")"
Range("D2").Select
Selection.AutoFill Destination:=Range(CopyrangeD)
'Copy and paste B
Range("B2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Final Results").Select
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
'Copy and paste D
Sheets("Insert Lists").Select
Range("D2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Final Results").Select
Range("B2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False