Range.AutoFormat Method
Automatically formats the specified range, using a predefined format.
Namespace: Microsoft.Office.Interop.Excel
Assembly: Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)
Syntax
'Declaration
Function AutoFormat ( _
Format As XlRangeAutoFormat, _
Number As Object, _
Font As Object, _
Alignment As Object, _
Border As Object, _
Pattern As Object, _
Width As Object _
) As Object
'Usage
Dim instance As Range
Dim Format As XlRangeAutoFormat
Dim Number As Object
Dim Font As Object
Dim Alignment As Object
Dim Border As Object
Dim Pattern As Object
Dim Width As Object
Dim returnValue As Object
returnValue = instance.AutoFormat(Format, _
Number, Font, Alignment, Border, Pattern, _
Width)
Object AutoFormat(
XlRangeAutoFormat Format,
Object Number,
Object Font,
Object Alignment,
Object Border,
Object Pattern,
Object Width
)
Parameters
Format
Type: Microsoft.Office.Interop.Excel.XlRangeAutoFormatOptional XlRangeAutoFormat. The specified AutoFormat.
Some of the XlRangeAutoFormat constants may not be available to you, depending on the language support (U.S. English, for example) that you’ve selected or installed.
Number
Type: System.ObjectOptional Object. True to include number formats in the AutoFormat. The default value is True.
Font
Type: System.ObjectOptional Object. True to include font formats in the AutoFormat. The default value is True.
Alignment
Type: System.ObjectOptional Object. True to include alignment in the AutoFormat. The default value is True.
Border
Type: System.ObjectOptional Object. True to include border formats in the AutoFormat. The default value is True.
Pattern
Type: System.ObjectOptional Object. True to include pattern formats in the AutoFormat. The default value is True.
Width
Type: System.ObjectOptional Object. True to include column width and row height in the AutoFormat. The default value is True.
Return Value
Type: System.Object
Remarks
If the range is a single cell, this method also formats the active region surrounding the cell.