全部显示

AutoFormat 方法

       

应用于 Range 对象的 AutoFormat 方法。

应用于 Chart 对象的 AutoFormat 方法。

说明

如果区域为单个单元格,则本方法也将设置该单元格周围活动区域的格式,换句话说,下列两条语句是等价的:

Cells("A1").AutoFormat
Cells("A1").CurrentRegion.AutoFormat

示例

本示例将预定义格式套用到 Sheet1 中的单元格区域 A1:D8 上。

Worksheets("Sheet1").Range("A1:D8"). _
    AutoFormat Format:=xlRangeAutoFormatClassic1