See, for example:
https://www.msofficeforums.com/16726-post2.html
You can choose whether to format all numbers in the table, or just the selected cells. As coded, all numbers in the selected cells get formatted as either #,##0.00 or $#,##0.00, depending on which option you choose.