Create a dynamic range name.

Insert>Name>Define... with a name of rngPop, and a Refersto value of

=OFFSET($A$1,,,COUNTA($A:$A),1)

and then use this in the function call

Sample(rngPop, no, True, False)