How do I delete multiple cell styles?

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
 
G

Gord Dibben

Please post the message ID for the edification of others.


Gord Dibben MS Excel MVP
 
T

Tony English

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top