Two questions I first want to be able to copy that entire row that lookup value is associated in and copy where I currently have it going below. Second how do I input a cell 3 (col A) to the left of the copied cells which are in col D. The text that I want to be inputed is"ExtraActuals." Thanks
Sub ExtraActuals()
Dim Res As Variant, lookupval As Variant
Dim lookuprng As Range, c As Range
Dim LR As Long
LR = Sheets("Actual").Cells(Rows.Count, "A").End(xlUp).Row
Set lookuprng = Worksheets("Expected").Range("A3:A1500")
For Each c In Sheets("Actual").Range("A3:A" & LR)
lookupval = c.Value
Res = Application.Match(lookupval, lookuprng, 0)
If IsError(Res) Then
Sheets("Compare Result").Cells(Rows.Count, "D").End(xlUp).Offset(5).Value = c.Value
End If
Next c
End Sub
Thanks
Sub ExtraActuals()
Dim Res As Variant, lookupval As Variant
Dim lookuprng As Range, c As Range
Dim LR As Long
LR = Sheets("Actual").Cells(Rows.Count, "A").End(xlUp).Row
Set lookuprng = Worksheets("Expected").Range("A3:A1500")
For Each c In Sheets("Actual").Range("A3:A" & LR)
lookupval = c.Value
Res = Application.Match(lookupval, lookuprng, 0)
If IsError(Res) Then
Sheets("Compare Result").Cells(Rows.Count, "D").End(xlUp).Offset(5).Value = c.Value
End If
Next c
End Sub
Thanks