The formula is nearly the same as given by Special-K with the 0 at the end being replaced by a 1
Formula: copy to clipboard
=IF(RANK(A1,A$1:A$7,1)>5,"",RANK(A1,A$1:A$7,1))


Changing the 0 to a 1 in the macro, should do what you want if you want it in macro form.