Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

ExcelRangeScope

OfficeIMO.Excel

Namespace
OfficeIMO.Excel
Assembly
OfficeIMO.Excel
Modifiers
sealed

Edits one ExcelRange: its fluent methods and keywords, each returning this scope.

Inheritance

  • object
  • ExcelRangeScope

Usage

Explore 25 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 1

Methods

public ExcelRangeScope Baseline() #

Restores every cell in the range to the normal baseline.

Returns

ExcelRangeScope The same scope.
public ExcelRangeScope Bold(bool bold = true) #

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

Parameters

bold bool = true optional
The value.

Returns

ExcelRangeScope The same scope.
Border 2 overloads
public ExcelRangeScope Border(ExcelBorderStyle style, OfficeColor? color = null) #

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

Parameters

style OfficeIMO.Excel.ExcelBorderStyle required
The value.
color OfficeIMO.OfficeColor? = null optional
The value.

Returns

ExcelRangeScope The same scope.
public ExcelRangeScope Border(ExcelCellBorders borders, ExcelBorderStyle style, OfficeColor? color = null) #

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

Parameters

borders OfficeIMO.Excel.ExcelCellBorders required
The value.
style OfficeIMO.Excel.ExcelBorderStyle required
The value.
color OfficeIMO.OfficeColor? = null optional
The value.

Returns

ExcelRangeScope The same scope.
public ExcelRangeScope Cell(int rowOffset, int columnOffset, Action<ExcelCellScope>? configure = null) #

Gets an editable cell using one-based offsets from this range's top-left cell.

Parameters

rowOffset int required
The value.
columnOffset int required
The value.
configure System.Action<OfficeIMO.Excel.ExcelCellScope>? = null optional
Configures the new item through its scope.

Returns

ExcelRangeScope The same scope.
public ExcelRangeScope Color(OfficeColor color) #

Applies a font color to every cell in the range.

Parameters

color OfficeIMO.OfficeColor required
The value.

Returns

ExcelRangeScope The same scope.
public ExcelRangeScope DiagonalBorder(ExcelBorderStyle style, OfficeColor? color = null, bool diagonalUp = true, bool diagonalDown = true) #

Applies diagonal borders to every cell in the range.

Parameters

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

ExcelRangeScope The same scope.
public ExcelRangeScope FillColor(OfficeColor color) #

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

Parameters

color OfficeIMO.OfficeColor required
The value.

Returns

ExcelRangeScope The same scope.
public ExcelRangeScope FontFamily(string fontFamily) #

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

Parameters

fontFamily string required
The value.

Returns

ExcelRangeScope The same scope.
public ExcelRangeScope FontSize(OfficeLength fontSize) #

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

Parameters

fontSize OfficeIMO.OfficeLength required
The value.

Returns

ExcelRangeScope The same scope.
public ExcelRangeScope GradientFill(OfficeColor fromColor, OfficeColor toColor, double degree = 0) #

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

Parameters

fromColor OfficeIMO.OfficeColor required
The value.
toColor OfficeIMO.OfficeColor required
The value.
degree double = 0 optional
The value.

Returns

ExcelRangeScope The same scope.
public ExcelRangeScope HorizontalAlignment(ExcelHorizontalAlignment alignment) #

Sets the horizontal alignment of every cell in the range.

Parameters

alignment OfficeIMO.Excel.ExcelHorizontalAlignment required
The value.

Returns

ExcelRangeScope The same scope.
public ExcelRangeScope Italic(bool italic = true) #

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

Parameters

italic bool = true optional
The value.

Returns

ExcelRangeScope The same scope.
public ExcelRangeScope NumberFormat(string numberFormat) #

Applies a number format to every cell in the range.

Parameters

numberFormat string required
The value.

Returns

ExcelRangeScope The same scope.
public ExcelRangeScope Sheet(Action<ExcelSheet> configure) #

Configures ExcelRange.Sheet in place: Gets the worksheet that owns the range.

Parameters

configure System.Action<OfficeIMO.Excel.ExcelSheet> required
Configures the value.

Returns

ExcelRangeScope The same scope.
public ExcelRangeScope ShrinkToFit(bool shrinkToFit = true) #

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

Parameters

shrinkToFit bool = true optional
The value.

Returns

ExcelRangeScope The same scope.
public ExcelRangeScope Strikethrough(bool strikethrough = true) #

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

Parameters

strikethrough bool = true optional
The value.

Returns

ExcelRangeScope The same scope.
public ExcelRangeScope Subscript() #

Formats every cell in the range as subscript.

Returns

ExcelRangeScope The same scope.
public ExcelRangeScope Superscript() #

Formats every cell in the range as superscript.

Returns

ExcelRangeScope The same scope.
public ExcelRangeScope TextRotation(int rotation) #

Sets Excel text rotation for every cell in the range.

Parameters

rotation int required
The value.

Returns

ExcelRangeScope The same scope.
Underline 2 overloads
public ExcelRangeScope Underline(bool underline = true) #

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

Parameters

underline bool = true optional
The value.

Returns

ExcelRangeScope The same scope.
public ExcelRangeScope Underline(ExcelUnderlineStyle underlineStyle) #

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

Parameters

underlineStyle OfficeIMO.Excel.ExcelUnderlineStyle required
The value.

Returns

ExcelRangeScope The same scope.
public ExcelRangeScope Values(object?[,] values) #

Writes a rectangular matrix whose dimensions exactly match this range.

Parameters

values object?[,] required
The value.

Returns

ExcelRangeScope The same scope.
public ExcelRangeScope VerticalAlignment(ExcelVerticalAlignment alignment) #

Sets the vertical alignment of every cell in the range.

Parameters

alignment OfficeIMO.Excel.ExcelVerticalAlignment required
The value.

Returns

ExcelRangeScope The same scope.
public ExcelRangeScope VerticalTextAlignment(ExcelVerticalTextAlignment alignment) #

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

Parameters

alignment OfficeIMO.Excel.ExcelVerticalTextAlignment required
The value.

Returns

ExcelRangeScope The same scope.
public ExcelRangeScope WrapText(bool wrapText = true) #

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

Parameters

wrapText bool = true optional
The value.

Returns

ExcelRangeScope The same scope.

Properties

public ExcelRange Model { get; } #

The ExcelRange this scope edits, for plain C# inside a lambda.