How to use sorting rules progrmmaticaly

Hi,
I have a grid that the user needs to change the sorting of about 7 columns to see different data.
To speed up the process I created some sorting rules for the grid and they are working fine.
I would like give the option to the user to change the sorting with the click of a button. I would like to have some buttons in the toolbar that, when clicked, would apply the sorting rule.
I couldn’t find an option in macros, is there a way to do it?