Use can use the Command option for specified idMso.
cancelDefault = False mean the builtin function will still be performed.
module code<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" >
<commands >
<command
idMso="SortAscendingExcel"
onAction="SortAscend_onAction"/>
</commands >
</customUI >
Sub SortAscend_onAction(control As IRibbonControl, ByRef cancelDefault) MsgBox "Sort Ascend" cancelDefault = False End Sub