This macro code might be a start:-
There is a list of 10 values in the first column. Key in a value into B3 and run the macro. Only the first rows up to the value in B3 will be shown. For example, enter 4 into B3 and only the first 4 rows will be shown. Each time you key in a value into B3, you will have to run the macro but I am sure there are ways to automatically run the macro if the value in B3 is changed.
test = Cells(3, 2).Value
Range("A1:A10").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _
Range(Cells(1, 1), Cells(test, 1)), Unique:=False