Rather than merging cells to center headers, I prefer to have text
across selection. This avoids problems with deleting and filling columns that are cosed by merged cells. The following sets up a command to toggle centering across columns.
Open up the AppleScript Editor, paste the following code and save it as
/Users/<your-username>/Documents/Microsoft User Data/Excel Script Menu
\sca in the filename creates a keyboard shortcut
-- Align selected cells across selection -- Copyright under GPL by Mark Grimes -- Saving with '\sca' in the filename creates Shortcut: Crtl+Shift+a tell application "Microsoft Excel" --activate tell range (get address selection) of active sheet if (get count columns) > 1 or (get count rows) > 1 then if (get horizontal alignment) is horizontal align center across selection then set horizontal alignment to horizontal align general else set horizontal alignment to horizontal align center across selection end if else if (get horizontal alignment) is horizontal align center then set horizontal alignment to horizontal align general else set horizontal alignment to horizontal align center end if end if end tell end tell
All comments are held for moderation; basic HTML formatting accepted.