I have code, which formats a table - it works with a cursor in a cell or if the table's selected - which is great to have both options.

However, if I have two or more tables on one slide, it always goes to one of the tables, and ignores other tables. I've spent days trying to fix this.

I want it to format the selected table (selected, and if the cursor is put in a cell of that table)?


Question: Pseudo-Code (based on it always goes to one of the tables, and ignores other tables.)

If 1 table on slide, then

If table selected or cursor in cell, then

Reformat

Else

Error message

Endif

ElseIf 2 tables on slide, then

If a table is selected or cursor in cell, then

Reformat just that table

Else

Error message

Endif