# ExcelRangeFluent

The fluent methods of ExcelRange, generated from its public properties: A property-named method sets a property and a singular-named method adds…

Class 

`OfficeIMO.Excel`

**Namespace**

`OfficeIMO.Excel`

**Assembly**

`OfficeIMO.Excel`

**Modifiers**

static

The fluent methods of [ExcelRange](/api/excel/officeimo-excel-excelrange/), generated from its public properties: A property-named method sets a property and a singular-named method adds to a collection, both returning the same instance.

## Inheritance

- object
- ExcelRangeFluent

Filter members 

Show inherited

## Methods

`public static ExcelRange Baseline(ExcelRange excelRange)` [#](#method-baseline-officeimo-excel-excelrange)

Restores every cell in the range to the normal baseline.

Parameters

**excelRange OfficeIMO.Excel.ExcelRange required**

The instance.

Returns

`ExcelRange` The same instance.

`public static ExcelRange Bold(ExcelRange excelRange, bool bold = true)` [#](#method-bold-officeimo-excel-excelrange-boolean)

Sets or clears bold font style for every cell in the range.

Parameters

**excelRange OfficeIMO.Excel.ExcelRange required**

The instance.

**bold bool = true optional**

The value.

Returns

`ExcelRange` The same instance.

Border 2 overloads

`public static ExcelRange Border(ExcelRange excelRange, ExcelBorderStyle style, OfficeColor? color = null)` [#](#method-border-officeimo-excel-excelrange-officeimo-excel-excelborderstyle-nullable-officeimo-officecolor)

Applies a border style to every edge of every cell in the range.

Parameters

**excelRange OfficeIMO.Excel.ExcelRange required**

The instance.

**style OfficeIMO.Excel.ExcelBorderStyle required**

The value.

**color OfficeIMO.OfficeColor? = null optional**

The value.

Returns

`ExcelRange` The same instance.

`public static ExcelRange Border(ExcelRange excelRange, ExcelCellBorders borders, ExcelBorderStyle style, OfficeColor? color = null)` [#](#method-border-officeimo-excel-excelrange-officeimo-excel-excelcellborders-officeimo-excel-excelborderstyle-nullable-officeimo-officecolor)

Sets selected border edges of every cell in the range while preserving other edges and styles.

Parameters

**excelRange OfficeIMO.Excel.ExcelRange required**

The instance.

**borders OfficeIMO.Excel.ExcelCellBorders required**

The value.

**style OfficeIMO.Excel.ExcelBorderStyle required**

The value.

**color OfficeIMO.OfficeColor? = null optional**

The value.

Returns

`ExcelRange` The same instance.

`public static ExcelRange Color(ExcelRange excelRange, OfficeColor color)` [#](#method-color-officeimo-excel-excelrange-officeimo-officecolor)

Applies a font color to every cell in the range.

Parameters

**excelRange OfficeIMO.Excel.ExcelRange required**

The instance.

**color OfficeIMO.OfficeColor required**

The value.

Returns

`ExcelRange` The same instance.

`public static ExcelRange DiagonalBorder(ExcelRange excelRange, ExcelBorderStyle style, OfficeColor? color = null, bool diagonalUp = true, bool diagonalDown = true)` [#](#method-diagonalborder-officeimo-excel-excelrange-officeimo-excel-excelborderstyle-nullable-officeimo-officecolor-boolean-boolean)

Applies diagonal borders to every cell in the range.

Parameters

**excelRange OfficeIMO.Excel.ExcelRange required**

The instance.

**style OfficeIMO.Excel.ExcelBorderStyle required**

The value.

**color OfficeIMO.OfficeColor? = null optional**

The value.

**diagonalUp bool = true optional**

The value.

**diagonalDown bool = true optional**

The value.

Returns

`ExcelRange` The same instance.

`public static ExcelRange FillColor(ExcelRange excelRange, OfficeColor color)` [#](#method-fillcolor-officeimo-excel-excelrange-officeimo-officecolor)

Applies a solid fill color to every cell in the range. Theme colors stay linked to the workbook theme.

Parameters

**excelRange OfficeIMO.Excel.ExcelRange required**

The instance.

**color OfficeIMO.OfficeColor required**

The value.

Returns

`ExcelRange` The same instance.

`public static ExcelRange FontFamily(ExcelRange excelRange, string fontFamily)` [#](#method-fontfamily-officeimo-excel-excelrange-string)

Applies a font family name to every cell in the range.

Parameters

**excelRange OfficeIMO.Excel.ExcelRange required**

The instance.

**fontFamily string required**

The value.

Returns

`ExcelRange` The same instance.

`public static ExcelRange FontSize(ExcelRange excelRange, OfficeLength fontSize)` [#](#method-fontsize-officeimo-excel-excelrange-officeimo-officelength)

Applies a positive physical font size to every cell in the range.

Parameters

**excelRange OfficeIMO.Excel.ExcelRange required**

The instance.

**fontSize OfficeIMO.OfficeLength required**

The value.

Returns

`ExcelRange` The same instance.

`public static ExcelRange GradientFill(ExcelRange excelRange, OfficeColor fromColor, OfficeColor toColor, double degree = 0)` [#](#method-gradientfill-officeimo-excel-excelrange-officeimo-officecolor-officeimo-officecolor-double)

Applies a two-color linear gradient fill to every cell in the range.

Parameters

**excelRange OfficeIMO.Excel.ExcelRange required**

The instance.

**fromColor OfficeIMO.OfficeColor required**

The value.

**toColor OfficeIMO.OfficeColor required**

The value.

**degree double = 0 optional**

The value.

Returns

`ExcelRange` The same instance.

`public static ExcelRange HorizontalAlignment(ExcelRange excelRange, ExcelHorizontalAlignment alignment)` [#](#method-horizontalalignment-officeimo-excel-excelrange-officeimo-excel-excelhorizontalalignment)

Sets the horizontal alignment of every cell in the range.

Parameters

**excelRange OfficeIMO.Excel.ExcelRange required**

The instance.

**alignment OfficeIMO.Excel.ExcelHorizontalAlignment required**

The value.

Returns

`ExcelRange` The same instance.

`public static ExcelRange Italic(ExcelRange excelRange, bool italic = true)` [#](#method-italic-officeimo-excel-excelrange-boolean)

Sets or clears italic font style for every cell in the range.

Parameters

**excelRange OfficeIMO.Excel.ExcelRange required**

The instance.

**italic bool = true optional**

The value.

Returns

`ExcelRange` The same instance.

`public static ExcelRange NumberFormat(ExcelRange excelRange, string numberFormat)` [#](#method-numberformat-officeimo-excel-excelrange-string)

Applies a number format to every cell in the range.

Parameters

**excelRange OfficeIMO.Excel.ExcelRange required**

The instance.

**numberFormat string required**

The value.

Returns

`ExcelRange` The same instance.

`public static ExcelRange Sheet(ExcelRange excelRange, Action<ExcelSheet> configure)` [#](#method-sheet-officeimo-excel-excelrange-action-officeimo-excel-excelsheet)

Configures [ExcelRange.Sheet](/api/excel/officeimo-excel-excelrange/) in place: Gets the worksheet that owns the range.

Parameters

**excelRange OfficeIMO.Excel.ExcelRange required**

The instance.

**configure System.Action<OfficeIMO.Excel.ExcelSheet> required**

Configures the value.

Returns

`ExcelRange` The same instance.

`public static ExcelRange ShrinkToFit(ExcelRange excelRange, bool shrinkToFit = true)` [#](#method-shrinktofit-officeimo-excel-excelrange-boolean)

Sets or clears shrink-to-fit text alignment for every cell in the range.

Parameters

**excelRange OfficeIMO.Excel.ExcelRange required**

The instance.

**shrinkToFit bool = true optional**

The value.

Returns

`ExcelRange` The same instance.

`public static ExcelRange Strikethrough(ExcelRange excelRange, bool strikethrough = true)` [#](#method-strikethrough-officeimo-excel-excelrange-boolean)

Sets or clears strikethrough font style for every cell in the range.

Parameters

**excelRange OfficeIMO.Excel.ExcelRange required**

The instance.

**strikethrough bool = true optional**

The value.

Returns

`ExcelRange` The same instance.

`public static ExcelRange Subscript(ExcelRange excelRange)` [#](#method-subscript-officeimo-excel-excelrange)

Formats every cell in the range as subscript.

Parameters

**excelRange OfficeIMO.Excel.ExcelRange required**

The instance.

Returns

`ExcelRange` The same instance.

`public static ExcelRange Superscript(ExcelRange excelRange)` [#](#method-superscript-officeimo-excel-excelrange)

Formats every cell in the range as superscript.

Parameters

**excelRange OfficeIMO.Excel.ExcelRange required**

The instance.

Returns

`ExcelRange` The same instance.

`public static ExcelRange TextRotation(ExcelRange excelRange, int rotation)` [#](#method-textrotation-officeimo-excel-excelrange-int32)

Sets Excel text rotation for every cell in the range.

Parameters

**excelRange OfficeIMO.Excel.ExcelRange required**

The instance.

**rotation int required**

The value.

Returns

`ExcelRange` The same instance.

Underline 2 overloads

`public static ExcelRange Underline(ExcelRange excelRange, bool underline = true)` [#](#method-underline-officeimo-excel-excelrange-boolean)

Sets or clears single underline font style for every cell in the range.

Parameters

**excelRange OfficeIMO.Excel.ExcelRange required**

The instance.

**underline bool = true optional**

The value.

Returns

`ExcelRange` The same instance.

`public static ExcelRange Underline(ExcelRange excelRange, ExcelUnderlineStyle underlineStyle)` [#](#method-underline-officeimo-excel-excelrange-officeimo-excel-excelunderlinestyle)

Sets the native Excel underline style for every cell in the range.

Parameters

**excelRange OfficeIMO.Excel.ExcelRange required**

The instance.

**underlineStyle OfficeIMO.Excel.ExcelUnderlineStyle required**

The value.

Returns

`ExcelRange` The same instance.

`public static ExcelRange Values(ExcelRange excelRange, object?[,] values)` [#](#method-values-officeimo-excel-excelrange-object-0-0)

Writes a rectangular matrix whose dimensions exactly match this range.

Parameters

**excelRange OfficeIMO.Excel.ExcelRange required**

The instance.

**values object?[,] required**

The value.

Returns

`ExcelRange` The same instance.

`public static ExcelRange VerticalAlignment(ExcelRange excelRange, ExcelVerticalAlignment alignment)` [#](#method-verticalalignment-officeimo-excel-excelrange-officeimo-excel-excelverticalalignment)

Sets the vertical alignment of every cell in the range.

Parameters

**excelRange OfficeIMO.Excel.ExcelRange required**

The instance.

**alignment OfficeIMO.Excel.ExcelVerticalAlignment required**

The value.

Returns

`ExcelRange` The same instance.

`public static ExcelRange VerticalTextAlignment(ExcelRange excelRange, ExcelVerticalTextAlignment alignment)` [#](#method-verticaltextalignment-officeimo-excel-excelrange-officeimo-excel-excelverticaltextalignment)

Sets the native Excel baseline, superscript, or subscript alignment for every cell in the range.

Parameters

**excelRange OfficeIMO.Excel.ExcelRange required**

The instance.

**alignment OfficeIMO.Excel.ExcelVerticalTextAlignment required**

The value.

Returns

`ExcelRange` The same instance.

`public static ExcelRange WrapText(ExcelRange excelRange, bool wrapText = true)` [#](#method-wraptext-officeimo-excel-excelrange-boolean)

Sets or clears text wrapping for every cell in the range.

Parameters

**excelRange OfficeIMO.Excel.ExcelRange required**

The instance.

**wrapText bool = true optional**

The value.

Returns

`ExcelRange` The same instance.

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

<!-- PowerForge markdown artifact sha256:F27051D1AEC257E5EAD89A4110012982FE202431CC47358FB628482EC4D5DE0E -->
