使用单个命令清除 Excel 单元格的内容和格式

Clear contents and formatting of an Excel cell with a single command

如果要清除 Microsoft Excel 中单元格或区域的内容,可以使用 .ClearContents。如果你也想清除格式,可以使用.ClearFormats.

Sheets("Test").Range("A1:C3").ClearContents
Sheets("Test").Range("A1:C3").ClearFormats

如果您想同时执行这两项操作,可以使用 .Delete,但随后电子表格中的其他单元格会移动以替换已删除的单元格。

Sheets("Test").Range("A1:C3").Delete

如何使用单个命令删除 中的内容 单元格或区域的格式设置,而不影响工作表的其余部分?

使用.Clear方法。

Sheets("Test").Range("A1:C3").Clear

MSDN documentation here.