I have an excel vba script that removes dupes from a spreadsheet. Works fine until more than a few hundred rows are in the sheet. Then it removes some but very few dupes. is there a limit on how much data can go through the advanced filter?
Here is the script..
Sub RemoveDupes()
'sort and remove duplicates
Range("A1").Select
LastRow = Cells.Find(what:="Trailer", LookIn:=xlValues, _
SearchDirection:=xlPrevious, _
SearchOrder:=xlByRows).Row
Lastcol = Cells.Find(what:="Trailer", LookIn:=xlValues, _
SearchDirection:=xlPrevious, _
SearchOrder:=xlByColumns).Column
Lr = LastRow - 1
LstCol = Lastcol - 5
Lc = Chr(LstCol + 64)
FirstCell = "A2"
LastCell = Lc & Lr
myrange = FirstCell & ":" & LastCell
' MsgBox MyRange
Range(myrange).AdvancedFilter Action:=xlFilterInPlace, Unique:=True
Range("A1").Select
End Sub
Here is the script..
Sub RemoveDupes()
'sort and remove duplicates
Range("A1").Select
LastRow = Cells.Find(what:="Trailer", LookIn:=xlValues, _
SearchDirection:=xlPrevious, _
SearchOrder:=xlByRows).Row
Lastcol = Cells.Find(what:="Trailer", LookIn:=xlValues, _
SearchDirection:=xlPrevious, _
SearchOrder:=xlByColumns).Column
Lr = LastRow - 1
LstCol = Lastcol - 5
Lc = Chr(LstCol + 64)
FirstCell = "A2"
LastCell = Lc & Lr
myrange = FirstCell & ":" & LastCell
' MsgBox MyRange
Range(myrange).AdvancedFilter Action:=xlFilterInPlace, Unique:=True
Range("A1").Select
End Sub