此代码已经工作了很长时间。 我想也许我意外地按了一把钥匙,但我似乎无法看到它。 我突然得到错误:
无法设置Range类的NumberFormat属性
在以下代码中:
Worksheets("Sheet1").Cells(y + k, x + j).Select TempValue = Worksheets("Sheet1").Cells(y + k, x + j).Value Worksheets("Sheet1").Cells(y + k, x + j).NumberFormat = "#,##0" //ERROR HERE Worksheets("Sheet1").Cells(y + k, x + j).Value = TempValueThis code has been working for ages. I thought maybe I accidently pressed a key but I cannot seem to see it. I suddenly get the error:
Unable to set the NumberFormat property of the Range class
in the below code:
Worksheets("Sheet1").Cells(y + k, x + j).Select TempValue = Worksheets("Sheet1").Cells(y + k, x + j).Value Worksheets("Sheet1").Cells(y + k, x + j).NumberFormat = "#,##0" //ERROR HERE Worksheets("Sheet1").Cells(y + k, x + j).Value = TempValue最满意答案
在Chat中发现的问题是工作簿有超过64,000种格式,因为用户在Excel中收到“ Too many different cells formats ”错误消息
解
主题:您在Excel中收到“太多不同的单元格格式”错误消息
链接 : http : //support.microsoft.com/kb/213904
从上面的链接中引用
在Microsoft Excel 2007/2010文件中可能会生成以下错误消息;
Excel在文件中找到了不可读的内容
当工作簿在Excel 2003中包含超过大约4,000种不同的单元格格式组合或在Excel 2007及更高版本中包含64,000时,会出现此问题。
链接中提到的解决方案是下载并运行XLStyesTool
The problem as discovered in Chat was the workbook had more than 64,000 formats because of which the user was getting the "Too many different cell formats" error message in Excel
Solution
Topic: You receive a "Too many different cell formats" error message in Excel
Link: http://support.microsoft.com/kb/213904
QUOTE from the above link
In Microsoft Excel 2007/2010 files may produce the following error message;
Excel found unreadable content in the file
This problem occurs when the workbook contains more than approximately 4,000 different combinations of cell formats in Excel 2003 or 64,000 in Excel 2007 and higher.
Solution as mentioned in the link is to download and run the XLStyesTool
更多推荐
发布评论