Close Tabbed Panels - is there a command?

Jordy’s macro worked well for my needs with a little tweaking for the particular panels I use. See this thread: How to toggle a docked panel?