The problem with multiple selection is that the formatting command is always called with the last valid Task ID.
The only thing can make thing somewhat simpler is to record or write a macro that does the formatting, delete the Task ID from the macro command for the formatting, and assign that to a button.
Then, you can use the multiple selection to format multiple rows.
TTFN