Move range selection for time selection in a function