Edit - Select Headers Only - Select Case Names Only

Ribbon bar. Select the Edit tab. In the Clipboard/Data group, click the Select All arrow and from the menu, select Select Case Names Only...

Classic menus. From the Edit - Select Headers Only submenu, select Select Case Names Only...

...to select only the case names associated with the currently selected cells. Note that once this command has been used, the appropriate case names will be selected, but the cells themselves will no longer be selected.

To select all case names, first select Select All followed by this command.