Hi David-
Leo's macro deletes unused _number_ formats. That's fine, certainly cannot
hurt, but number formatting is just a part of what comprises a cell's
format.
The larger issue in the "too many different cell formats" problem has little
or nothing to do with _unused_ number formats. It has to do with having too
many combinations of formatting elements actually in use.
Or to quote from MSKB 213904:
"This problem occurs when the workbook contains more than approximately
4,000 different combinations of cell formats. A combination is defined as a
unique set of formatting elements that are applied to a cell. A combination
includes all font formatting (for example: typeface, font size, italic,
bold, and underline), borders (for example: location, weight, and color),
cell patterns, number formatting, alignment, and cell protection."
I call each of the combinations referred to in the quote a "style". A
"named style" (that appears in the Format, Style list) is a subset of the
total "styles". In your typical large workbook, with lots of formatting,
the named styles are just a fraction of the number of total styles.
So, again, it's not unused number formats, but total "styles" used that is
the problem in ""too many different cell formats". I wish I had an good
answer to this problem. My macro can produce a list of all styles used in a
workbook but that doesn't do a whole lot since there is nothing you can do
based on the list (well I guess it could be a warning about getting close to
the limit). I guess that's why MS's solution is to "use less
formatting".<g>