API Reference
ExcelRange
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
- Method ExcelRange.ApplyAutoFilter
- Method ExcelRange.Clear
- Method ExcelRange.ClearAutoFilter
- Method ExcelRange.Currency
- Method ExcelRange.Date
- Method ExcelRange.DateTime
- Method ExcelRange.DurationHours
- Method ExcelRange.Error
- Method ExcelRange.HeaderStyle
- Method ExcelRange.Integer
- Method ExcelRange.Merge
- Method ExcelRange.MutedText
- Method ExcelRange.Number
- Method ExcelRange.Percent
- Method ExcelRange.SetBold
- Method ExcelRange.SetFillColor
- Method ExcelRange.SetFontColor
- Method ExcelRange.SetNumberFormat
- Method ExcelRange.SortByColumn
- Method ExcelRange.Success
- Method ExcelRange.Text
- Method ExcelRange.Time
- Method ExcelRange.Unmerge
- Method ExcelRange.Warning
- Method ExcelRangeConditionalFormattingBuilder.Between
- Method ExcelRangeConditionalFormattingBuilder.Bottom
- Method ExcelRangeConditionalFormattingBuilder.CellIs
- Method ExcelRangeConditionalFormattingBuilder.Clear
- Method ExcelRangeConditionalFormattingBuilder.ColorScale
- Method ExcelRangeConditionalFormattingBuilder.ColorScale
- Method ExcelRangeConditionalFormattingBuilder.DataBar
- Method ExcelRangeConditionalFormattingBuilder.DataBar
- Method ExcelRangeConditionalFormattingBuilder.DuplicateValues
- Method ExcelRangeConditionalFormattingBuilder.Formula
- Method ExcelRangeConditionalFormattingBuilder.GreaterThan
- Method ExcelRangeConditionalFormattingBuilder.IconSet
- Method ExcelRangeConditionalFormattingBuilder.IconSet
- Method ExcelRangeConditionalFormattingBuilder.LessThan
- Method ExcelRangeConditionalFormattingBuilder.Top
- Method ExcelRangeDataValidationBuilder.Clear
- Method ExcelRangeDataValidationBuilder.CustomFormula
- Method ExcelRangeDataValidationBuilder.Date
- Method ExcelRangeDataValidationBuilder.DateBetween
- Method ExcelRangeDataValidationBuilder.Decimal
- Method ExcelRangeDataValidationBuilder.DecimalBetween
- Method ExcelRangeDataValidationBuilder.List
- Method ExcelRangeDataValidationBuilder.List
- Method ExcelRangeDataValidationBuilder.ListNamedRange
- Method ExcelRangeDataValidationBuilder.ListRange
- Method ExcelRangeDataValidationBuilder.Messages
- Method ExcelRangeDataValidationBuilder.TextLength
- Method ExcelRangeDataValidationBuilder.Time
- Method ExcelRangeDataValidationBuilder.WholeNumber
- Method ExcelRangeDataValidationBuilder.WholeNumberBetween
- Method ExcelSheet.Range
- Method ExcelTable.AsRange
Methods
public ExcelRange ApplyAutoFilter(Dictionary<UInt32, IEnumerable<String>> filterCriteria = null) #ExcelRangeApplies 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
public ExcelRange Clear(ExcelClearOptions options = All) #ExcelRangeClears selected data and metadata from the range.
Parameters
- options OfficeIMO.Excel.ExcelClearOptions = All
public ExcelTable CreateTable(String name, Boolean hasHeader = true, TableStyle style = TableStyleMedium2, Boolean includeAutoFilter = true) #ExcelTableCreates an Excel table over the range.
Parameters
- name System.String
- hasHeader System.Boolean = true
- style OfficeIMO.Excel.TableStyle = TableStyleMedium2
- includeAutoFilter System.Boolean = true
public ExcelRange Currency(Int32 decimals = 2, CultureInfo culture = null) #ExcelRangeApplies a currency number format.
Parameters
- decimals System.Int32 = 2
- culture System.Globalization.CultureInfo = null
public ExcelRange Date(String pattern = "yyyy-mm-dd") #ExcelRangeApplies a date number format.
Parameters
- pattern System.String = "yyyy-mm-dd"
public ExcelRange DateTime(String pattern = "yyyy-mm-dd hh:mm:ss") #ExcelRangeApplies a date/time number format.
Parameters
- pattern System.String = "yyyy-mm-dd hh:mm:ss"
public ExcelRange Integer() #ExcelRangeApplies a whole-number format with thousands separators.
public ExcelRange Number(Int32 decimals = 2) #ExcelRangeApplies a decimal number format.
Parameters
- decimals System.Int32 = 2
public ExcelRange Percent(Int32 decimals = 0) #ExcelRangeApplies a percent number format.
Parameters
- decimals System.Int32 = 0
public ExcelRange SetBold(Boolean bold = true) #ExcelRangeSets or clears bold font style for every cell in the range.
Parameters
- bold System.Boolean = true
public ExcelRange SetFillColor(String hexColor) #ExcelRangeApplies a fill color to every cell in the range.
Parameters
- hexColor System.String
public ExcelRange SetFontColor(String hexColor) #ExcelRangeApplies a font color to every cell in the range.
Parameters
- hexColor System.String
public ExcelRange SetNumberFormat(String numberFormat) #ExcelRangeApplies a number format to every cell in the range.
Parameters
- numberFormat System.String
public ExcelRange SortByColumn(Int32 columnOffset, Boolean ascending = true, Boolean hasHeader = true) #ExcelRangeSorts the range by a 1-based column offset.
Parameters
- columnOffset System.Int32
- ascending System.Boolean = true
- hasHeader System.Boolean = true
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object
Properties
public ExcelSheet Sheet { get; } #Gets the worksheet that owns the range.
public Int32 FirstColumn { get; } #Gets the first column 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.