API Reference

Class

ExcelRange

Namespace OfficeIMO.Excel
Assembly OfficeIMO.Excel
Modifiers sealed

Lightweight object model wrapper for an A1 range.

Inheritance

  • Object
  • ExcelRange

Usage

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

Returned or exposed by

Methods

public ExcelRange ApplyAutoFilter(Dictionary<UInt32, IEnumerable<String>> filterCriteria = null) #
Returns: ExcelRange

Applies AutoFilter to the range using optional zero-based column criteria.

Parameters

filterCriteria System.Collections.Generic.Dictionary{System.UInt32,System.Collections.Generic.IEnumerable{System.String}} = null optionalposition: 0
public ExcelRange Clear(ExcelClearOptions options = All) #
Returns: ExcelRange

Clears selected data and metadata from the range.

Parameters

options OfficeIMO.Excel.ExcelClearOptions = All optionalposition: 0
public ExcelRange ClearAutoFilter() #
Returns: ExcelRange

Clears the worksheet AutoFilter.

public ExcelTable CreateTable(String name, Boolean hasHeader = true, TableStyle style = TableStyleMedium2, Boolean includeAutoFilter = true) #
Returns: ExcelTable

Creates an Excel table over the range.

Parameters

name System.String requiredposition: 0
hasHeader System.Boolean = true optionalposition: 1
style OfficeIMO.Excel.TableStyle = TableStyleMedium2 optionalposition: 2
includeAutoFilter System.Boolean = true optionalposition: 3
public ExcelRange Currency(Int32 decimals = 2, CultureInfo culture = null) #
Returns: ExcelRange

Applies a currency number format.

Parameters

decimals System.Int32 = 2 optionalposition: 0
culture System.Globalization.CultureInfo = null optionalposition: 1
public ExcelRange Date(String pattern = "yyyy-mm-dd") #
Returns: ExcelRange

Applies a date number format.

Parameters

pattern System.String = "yyyy-mm-dd" optionalposition: 0
public ExcelRange DateTime(String pattern = "yyyy-mm-dd hh:mm:ss") #
Returns: ExcelRange

Applies a date/time number format.

Parameters

pattern System.String = "yyyy-mm-dd hh:mm:ss" optionalposition: 0
public ExcelRange DurationHours() #
Returns: ExcelRange

Applies an elapsed-hours duration format.

public ExcelRange Error() #
Returns: ExcelRange

Applies an error status style.

public ExcelRange HeaderStyle() #
Returns: ExcelRange

Applies a simple report header style.

public ExcelRange Integer() #
Returns: ExcelRange

Applies a whole-number format with thousands separators.

public ExcelRange Merge() #
Returns: ExcelRange

Merges the range.

public ExcelRange MutedText() #
Returns: ExcelRange

Applies a muted text style.

public ExcelRange Number(Int32 decimals = 2) #
Returns: ExcelRange

Applies a decimal number format.

Parameters

decimals System.Int32 = 2 optionalposition: 0
public ExcelRange Percent(Int32 decimals = 0) #
Returns: ExcelRange

Applies a percent number format.

Parameters

decimals System.Int32 = 0 optionalposition: 0
public ExcelRange SetBold(Boolean bold = true) #
Returns: ExcelRange

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

Parameters

bold System.Boolean = true optionalposition: 0
public ExcelRange SetFillColor(String hexColor) #
Returns: ExcelRange

Applies a fill color to every cell in the range.

Parameters

hexColor System.String requiredposition: 0
public ExcelRange SetFontColor(String hexColor) #
Returns: ExcelRange

Applies a font color to every cell in the range.

Parameters

hexColor System.String requiredposition: 0
public ExcelRange SetNumberFormat(String numberFormat) #
Returns: ExcelRange

Applies a number format to every cell in the range.

Parameters

numberFormat System.String requiredposition: 0
public ExcelRange SortByColumn(Int32 columnOffset, Boolean ascending = true, Boolean hasHeader = true) #
Returns: ExcelRange

Sorts the range by a 1-based column offset.

Parameters

columnOffset System.Int32 requiredposition: 0
ascending System.Boolean = true optionalposition: 1
hasHeader System.Boolean = true optionalposition: 2
public ExcelRange Success() #
Returns: ExcelRange

Applies a positive/success status style.

public ExcelRange Text() #
Returns: ExcelRange

Applies a text number format.

public ExcelRange Time() #
Returns: ExcelRange

Applies a time number format.

public ExcelRange Unmerge() #
Returns: ExcelRange

Removes merge definitions that overlap the range.

public ExcelRange Warning() #
Returns: ExcelRange

Applies a warning status style.

Properties

public ExcelSheet Sheet { get; } #

Gets the worksheet that owns the range.

public String Address { get; } #

Gets the A1 range address.

public Int32 FirstRow { get; } #

Gets the first row in the range.

public Int32 FirstColumn { get; } #

Gets the first column in the range.

public Int32 LastRow { get; } #

Gets the last row in the range.

public Int32 LastColumn { get; } #

Gets the last column in the range.

public ExcelCell FirstCell { get; } #

Gets a wrapper for the top-left cell.

public ExcelRangeDataValidationBuilder Validation { get; } #

Builds data validation rules for the range.

public ExcelRangeDataValidationBuilder Validate { get; } #

Builds data validation rules for the range.

public ExcelRangeConditionalFormattingBuilder ConditionalFormatting { get; } #

Builds conditional formatting rules for the range.

public ExcelRangeConditionalFormattingBuilder ConditionalFormat { get; } #

Builds conditional formatting rules for the range.