谁能解决exceltoomany
excel2003有限制一个工作薄最多4000种格式,当格式超过这个就会出现“不同单元格格式太多”(中文简体) 或“太多不同的储存格格式”(中文繁体)或"too many different cell formats"(英文版)的错误。
还有一种情况也会出现这个错误:在用2003(或更低版本)打开2007的文件的时候,遇到了03中没有的格式。
其实,解决的方法很简单。
1。 全选、复制、粘贴成值到另一个excel中。
2。 已txt文档为中介,先存成txt,再转成excel。
3。 利用宏
Sub R...全部
excel2003有限制一个工作薄最多4000种格式,当格式超过这个就会出现“不同单元格格式太多”(中文简体) 或“太多不同的储存格格式”(中文繁体)或"too many different cell formats"(英文版)的错误。
还有一种情况也会出现这个错误:在用2003(或更低版本)打开2007的文件的时候,遇到了03中没有的格式。
其实,解决的方法很简单。
1。 全选、复制、粘贴成值到另一个excel中。
2。 已txt文档为中介,先存成txt,再转成excel。
3。 利用宏
Sub RebuildDefaultStyles()
'The purpose of this macro is to remove all styles in the active
'workbook and rebuild the default styles。
'It rebuilds the default styles by merging them from a new workbook。
'Dimension variables。
Dim MyBook As Workbook
Dim tempBook As Workbook
Dim CurStyle As Style
'Set MyBook to the active workbook。
Set MyBook = ActiveWorkbook
On Error Resume Next
'Delete all the styles in the workbook。
For Each CurStyle In MyBook。Styles
'If CurStyle。Name <> "Normal" Then CurStyle。Delete
Select Case CurStyle。
Name
Case "20% - Accent1", "20% - Accent2", _
"20% - Accent3", "20% - Accent4", "20% - Accent5", "20% - Accent6", _
"40% - Accent1", "40% - Accent2", "40% - Accent3", "40% - Accent4", _
"40% - Accent5", "40% - Accent6", "60% - Accent1", "60% - Accent2", _
"60% - Accent3", "60% - Accent4", "60% - Accent5", "60% - Accent6", _
"Accent1", "Accent2", "Accent3", "Accent4", "Accent5", "Accent6", _
"Bad", "Calculation", "Check Cell", "Comma", "Comma [0]", "Currency", _
"Currency [0]", "Explanatory Text", "Good", "Heading 1", "Heading 2", _
"Heading 3", "Heading 4", "Input", "Linked Cell", "Neutral", "Normal", _
"Note", "Output", "Percent", "Title", "Total", "Warning Text"
'Do nothing, these are the default styles
Case Else
CurStyle。
Delete
End Select
Next CurStyle
'Open a new workbook。
Set tempBook = Workbooks。
Add
'Disable alerts so you may merge changes to the Normal style
'from the new workbook。
Application。DisplayAlerts = False
'Merge styles from the new workbook into the existing workbook。
MyBook。Styles。Merge Workbook:=tempBook
'Enable alerts。
Application。DisplayAlerts = True
'Close the new workbook。
tempBook。Close
End Sub
三种方法原理相同,就是要去除格式。
第一、二种方法比较笨重但简单,只是如果一个工作表有十几个sheet,岂不是要操作 N*3(N=工作表的个数);第三种方法可以对所有的sheet一次操作,但不会应用宏(巨集)的人就比较麻烦了。收起