I am using a macro to select a range of names based on date. I then want to remove the duplicates in the selection. My macro runs fine however it does not remove duplicates like it is supposed to and returns no errors. What am I doing wrong in my code?
sub Remove_Duplicates()
Dim mRow As Long
Dim mStart As Long, mEnd As Long
Dim rng As Range
Worksheets("Weekely").Select
For mRow = 1 To 65536
If Range("G" & mRow).Value = "2016" Then
mStart = mRow
Exit For
End If
Next mRow
' Figure out where the "2016" data ends.
For mRow = mStart To 65536
If Range("G" & mRow).Value <> "2016" Then
mEnd = mRow
Exit For
End If
Next mRow
mEnd = mEnd - 1
Set rng = Range("G" & mStart & ":G" & mEnd).Offset(0, 1)
rng.RemoveDuplicates
End Sub