Range.AutoFormat 方法

定义

使用预定义的格式自动设置指定范围的格式。

public object AutoFormat(Microsoft.Office.Interop.Excel.XlRangeAutoFormat Format = Microsoft.Office.Interop.Excel.XlRangeAutoFormat.xlRangeAutoFormatClassic1, object Number, object Font, object Alignment, object Border, object Pattern, object Width);
Public Function AutoFormat (Optional Format As XlRangeAutoFormat = Microsoft.Office.Interop.Excel.XlRangeAutoFormat.xlRangeAutoFormatClassic1, Optional Number As Object, Optional Font As Object, Optional Alignment As Object, Optional Border As Object, Optional Pattern As Object, Optional Width As Object) As Object

参数

Format
XlRangeAutoFormat

可选 XlRangeAutoFormat. 指定的 AutoFormat。某些 XlRangeAutoFormat 常量可能不可用,具体取决于对美国英语 (语言支持,例如选择或安装的) 。

Number
Object

可选 对象。 如果为 true,则在自动格式中包括数字格式。 默认值是 ,则返回 True。

Font
Object

可选 对象。 如果为 true,则在自动格式中包括字体格式。 默认值为 True

Alignment
Object

可选 对象。 如果为 true,则在自动格式中包括对齐方式。 默认值为 True

Border
Object

可选 对象。 如果为 true,则在自动格式中包括边框格式。 默认值为 True

Pattern
Object

可选 对象。 如果为 true,则在自动格式中包括模式格式。 默认值为 True

Width
Object

可选 对象。 如果为 true,则在自动格式中包括列宽和行高。 默认值为 True

返回

注解

如果区域是单个单元格,则此方法还会格式化单元格周围的活动区域。

适用于