I am trying to filter and sort the Top 10 values in my spreadsheet but it keeps throwing up the '1004 Autofilter method of Range class failed' error, with the third line being highlighted.
My code is:
The column being filtered and sorted contains £values but some are #N/A - will this be what is affecting the code?
If so, how do I get around this?
Many Thanks
My code is:
Code:
Range("B9:CS50").Select
Selection.Autofilter
Selection.Autofilter Field:=53, Criteria1="10", Operator:=xlTop10Items
Range("B10:CS50").Sort Key1:=Range("AW10"), Order:=xlDescending, Header _
:=xlGuess, OrderCustom:=1, MatchCase:=False, Oreientation:=xlTopToBottom _
, DataOption1:=xlSortNormal
The column being filtered and sorted contains £values but some are #N/A - will this be what is affecting the code?
If so, how do I get around this?
Many Thanks