Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

ExcelRangeFluent

OfficeIMO.Excel

Namespace
OfficeIMO.Excel
Assembly
OfficeIMO.Excel
Modifiers
static

The fluent methods of 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

Methods

public static ExcelRange Baseline(ExcelRange 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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

Configures ExcelRange.Sheet 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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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.