MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Apr 4th, 2002, 11:38 AM   #1
klb
Board Regular
 
Join Date: Apr 2002
Location: Minnesota
Posts: 821
Default

I have a style in a large and complicated workbook (over 20 sheets) that I want to delete. Unfortunately it once was a Normal style in another workbook and I have been unable to delete it. I also have a "regular" Normal style that cannot be deleted.

I am trying to clean up this workbook for distribution to others in our organization. There are sheets within the workbook that will be made a part of other workbooks. Getting rid of this unwanted style is not critical it is just one of those things that bug me. (we have all been there)

Any help would be greatly appreciated.

klb is offline   Reply With Quote
Old Apr 4th, 2002, 03:16 PM   #2
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

There's an ASAP Utilities | Format | Remove all unused styles... menu command installed by the free ASAP Utilities add-in. See www.asap-utilities.com.

[ This Message was edited by: Mark W. on 2002-04-04 14:16 ]
Mark W. is offline   Reply With Quote
Old Apr 4th, 2002, 04:31 PM   #3
Jack in the UK
Board Regular
 
Join Date: Feb 2002
Posts: 3,064
Default

Hi

Just a change will resetting format style to normal and modify button to catergory general.. if my memeory is any good will this not remove the now set style.. ie ste to defaut...


__________________
Free Excel based Web Toolbar available here.

Jack in the UK
J & R Excel Solutions
"making Excel work for you"
Jack in the UK is offline   Reply With Quote
Old Apr 5th, 2002, 06:49 AM   #4
klb
Board Regular
 
Join Date: Apr 2002
Location: Minnesota
Posts: 821
Default

Mark, Thanks for the info on the ASAP Utilities. Installed them and I know I will find them useful but....even though I tried the "remove unused styles", the style is still there.

This may have worked IF I could find where this style is being used. Have not been able to figure out a way to search for a style.

Like I said Excel is protecting this style the same way it does the "Normal" style. Did just notice an added little quirk, the problem style has a space at the end of its name. I don't know if this makes a difference or not.

Thanks
klb is offline   Reply With Quote
Old Apr 5th, 2002, 07:57 AM   #5
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

klb, what if you modified the "offending" style to display some "eye-popping" pattern. Perhaps that would help you find where it was being used.
Mark W. is offline   Reply With Quote
Old Apr 5th, 2002, 08:25 AM   #6
klb
Board Regular
 
Join Date: Apr 2002
Location: Minnesota
Posts: 821
Default

Changed the color and font size so that it would jump out. The style is not being used. After running the asap utility I get a message to the effect that there were 13 styles and 12 are in use. The other 18 were removed. I know, the math doesn't make sense to me either.

Saved and then closed the file. Reopened it and ran the utility again with the same results.

Net result is the style is still there.

klb is offline   Reply With Quote
Old Apr 5th, 2002, 08:33 AM   #7
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

Sounds like you might be dealing with a corrupt worksheet. What if you use Copy/Paste Special... to move the contents and formats to another workbook?
Mark W. is offline   Reply With Quote
Old Apr 5th, 2002, 08:45 AM   #8
klb
Board Regular
 
Join Date: Apr 2002
Location: Minnesota
Posts: 821
Default

Already tried that but.....

There are almost 600 ranges named in the original sheet and each would have to be redefined. There is considerable formatting on some of the sheets. That is why I am looking for some other way to eliminate the style.

If I copy the sheet, then the styles come with the copied sheets. And can't be deleted in the copied worksheet either.

You aren't the first person to be stumped by this problem.
klb is offline   Reply With Quote
Old Apr 13th, 2011, 04:06 PM   #9
DrillRaider
New Member
 
Join Date: Apr 2011
Location: Bergenfield, NJ
Posts: 2
Default Re: Style problem - unable to delete it

Hi everyone. This is my first time posting on this forum. I actually found a solution to this issue and want to contribute.

Here are the step-by-step process in removing all styles including the ones with invalid names:

1. Rename your Excel workbook from .xlsx or .xlsm to .zip

2. Open the workbook with WinZip and navigate to xl folder

3. Right click on styles.xml and choose Open With Notepad

4. Hit Ctrl F to search for cellstyles (with the open XML tag mark in the front, can't make it show in the post)

5. Cancel out of the find dialogue box, move your cursor before cellstyles and hit enter twice (this is to mark where the beginning of this tag is)

6. Hit Ctrl F again and search for /cellstyles>

7. Highlight everything between step 5 and step 6 (everything in the cellstyles tags including the tags) and hit delete

8. Save the Notepad and exit Notepad. WinZip should now ask you whether to update the file. Select Update Zip file with changes. Hit OK and close out WinZip.

9. Rename the workbook zip file back to .xlsx or .xlsm

The deed is done!
DrillRaider is offline   Reply With Quote
Old Apr 18th, 2011, 12:34 PM   #10
DrillRaider
New Member
 
Join Date: Apr 2011
Location: Bergenfield, NJ
Posts: 2
Default Re: Style problem - unable to delete it

Actually, I need to revise the solution I provided:

HTML Code:
1. Rename your Excel workbook from .xlsx or .xlsm to .zip

2. Open the workbook with WinZip and navigate to xl folder

3. Right click on styles.xml and choose Open With Notepad

4. Hit Ctrl F to search for "<cellstyles"

5. Replace everything between "<cellstyles" and "/cellstyles>" with the following XML code:
  <cellStyles count="1">
    <cellStyle name="Normal" xfId="0" builtinId="0" customBuiltin="1" />
  </cellStyles>

6. Save the Notepad and exit Notepad. WinZip should now ask you whether to update the file. Select Update Zip file with changes. Hit OK and close out WinZip.

7. Rename the workbook zip file back to .xlsx or .xlsm
The reason that you need to keep this section is that if you try to save the .xlsm or .xlsx as .xlsb, and resave the .xlsb, it will give you an error.
DrillRaider is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 06:41 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes