I am getting an error on the code below, and not sure why. Can somebody shed some light? (The macro isn't complete btw)
Code:
Sub SortAndRemoveDupes()
Dim lastCell, lastContact As Long
Dim rListSort, rOldList As Range
Dim strRowSource As String
Set lastCell = Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Row
[COLOR=red]Set lastContact = Sheets("Contact").Range("H" & Row.Count).End(xlUp).Row[/COLOR]
Sheets("Sheet2").Range("A1:E" & lastCell).Clear
Set rOldList = Sheets("Contact").Range("D2:H" & lastContact)
'copy unique list to sheet2
rOldList.AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=Sheet2.Cells(1, 1), Unique:=True
'Set range variable to the new non dupe list
Set rListSort = Sheet2.Range("A1", Sheet1.Range("E").End(xlUp))
End Sub