benjinorth
New Member
- Joined
- Jul 25, 2016
- Messages
- 13
Hi All,
I'm using this current code which works fine until i have more than the specified amount of rows,
I tried replacing the highlighted line of code with:
"ActiveSheet.Range("A1:K" & Lastrow).RemoveDuplicates Columns:=2, Header:=xlYes"
but I get an error.
Anybody have any solutions that would be great
I'm using this current code which works fine until i have more than the specified amount of rows,
I tried replacing the highlighted line of code with:
"ActiveSheet.Range("A1:K" & Lastrow).RemoveDuplicates Columns:=2, Header:=xlYes"
but I get an error.

Anybody have any solutions that would be great
Code:
Sub ClearDups()
Worksheets("Copy Me Here").Select
ActiveSheet.AutoFilter.Sort.SortFields.Clear
ActiveSheet.AutoFilter.Sort.SortFields.Add Key _
:=Range("F1:F137"), SortOn:=xlSortOnValues, Order:=xlDescending, _
DataOption:=xlSortNormal
With ActiveSheet.AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
[I][B][COLOR=#0000cd] ActiveSheet.Range("A1:K491").RemoveDuplicates Columns:=2, Header:=xlYes[/COLOR][/B][/I]
Sheets("MAIN PAGE").Select
End Sub