How do I delete multiple cell styles?

  • Thread starter Thread starter SierraMike
  • Start date Start date
S

SierraMike

I have a large spreadsheet that someone must have attempted to past into
without using text or unicode text options. As a result it added hundreds of
extraneous cell styles. Is there any way to delete multiple cell styles at
once? One at a time will take forever.

Thanks
 
For those also struggling with this issue!

We are having lots of poblems with styles in excel at present. It seems
that if you have 2 instances of Excel open and copy data from one to the
other the styles in the copied from sheet get added to the copied to sheet.
That way the overall style count increases.

To get rid of them we use this bit of code


sub removeStyles
dim sty as style
for each sty in activeworkbook.styles
if sty.builtin = false then
sty.delete
end if
next
end sub

this will remove all the non builting Excel styles but we are also finding
that the number classed as builtin is increasing also.

Regards,

Tony
 
Back
Top