User select sort

is there a way to activate the sort on a particular column either by LS or formula language?

or does it have to be done by user clicking on the column