VBA宏不适用于ClearContentsNotFormulas [英] VBA Macro Not Working For ClearContentsNotFormulas
问题描述
您好: 我创建了一个宏,ClearContentsNotFormulas(见下文),在使用这个宏之前,我验证了具有我要清除的公式并保留公式的单元格中的数据是CellType = Values,但宏不起作用?
Hi: I created a macro, ClearContentsNotFormulas (see below), and before using this macro, I validated that the data in the cells with formulas that I want to clear and leave the formulas is CellType = Values, but the macro does not work?
这些值是从不同的Excel文件粘贴链接的,当它出现在我的目标Excel文件中时,它们所在的单元格被格式化为"百分比"。 例如,53%(即所有"值"具有%符号)。
The values are paste linked from a different Excel file and when the appear in my target Excel file, the cells they are in are formatted as "Percentage." For example, 53% (i.e., all "Values" have the % sign).
如何解决此问题。 我期待着您的回复并感谢您的帮助。
How do I fix this problem. I look forward to your response and thanks for your help.
FrankHW
推荐答案
您对实际称为常量的值使用了不正确的参数(参数)。
You have used the incorrect parameter (argument) for the values which are actually referred to as constants.
Cells.SpecialCells(xlCellTypeConstants).ClearContents
Cells.SpecialCells(xlCellTypeConstants).ClearContents
请参阅以下链接了解xlCellType枚举
See the following link for the xlCellType enumeration
这篇关于VBA宏不适用于ClearContentsNotFormulas的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!