主题
ClearContents (方法)
清除区域中的公式。
示例
python
#此示例清除工作表 Sheet1 上 A1:G37 单元格区域的公式,但保留其格式设置
def test():
Application.Worksheets.Item("Sheet1").Range("A1:G37").ClearContents()
python
#本示例将 A1 单元格的字体加粗,然后使用 ClearContents 清除 A1 单元格内容
def test():
Range("A1").Font.Bold = True
Range("A1").ClearContents()