最近公司有用户反映excel复制内容粘贴报错“不同的单元格格式太多”,后来怀疑应该是样式问题,一看样式吓了一跳,好多无用的样式(如下图)。

那就删除样式吧,可是怎么批量删除呢,中文的搜索结果都没搞定,那就试试英文的吧,还别说,与可行的解决方案,请往下看:

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

 

 

 posted on 2012-10-24 12:01  一杯清水的幸福  阅读(14244)  评论(0编辑  收藏  举报