本文整理汇总了C#中ClosedXML.Excel.XLWorkbook.Cells方法的典型用法代码示例。如果您正苦于以下问题:C# XLWorkbook.Cells方法的具体用法?C# XLWorkbook.Cells怎么用?C# XLWorkbook.Cells使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ClosedXML.Excel.XLWorkbook
的用法示例。
在下文中一共展示了XLWorkbook.Cells方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Cells1
public void Cells1()
{
var wb = new XLWorkbook();
IXLCells cells = wb.Cells("ABC");
Assert.IsNotNull(cells);
Assert.AreEqual(0, cells.Count());
}
示例2: Cells3
public void Cells3()
{
var wb = new XLWorkbook();
IXLWorksheet ws = wb.AddWorksheet("Sheet1");
ws.FirstCell().SetValue(1).AddToNamed("Result");
IXLCells cells = wb.Cells("Sheet1!Result, ABC");
Assert.IsNotNull(cells);
Assert.AreEqual(1, cells.Count());
Assert.AreEqual(1, cells.First().GetValue<Int32>());
}
示例3: WbNamedCells
public void WbNamedCells()
{
var wb = new XLWorkbook();
IXLWorksheet ws = wb.Worksheets.Add("Sheet1");
ws.Cell(1, 1).SetValue("Test").AddToNamed("TestCell");
ws.Cell(2, 1).SetValue("B").AddToNamed("Test2");
IXLCells wbCells = wb.Cells("TestCell, Test2");
Assert.AreEqual("Test", wbCells.First().GetString());
Assert.AreEqual("B", wbCells.Last().GetString());
IXLCells wsCells = ws.Cells("TestCell, Test2");
Assert.AreEqual("Test", wsCells.First().GetString());
Assert.AreEqual("B", wsCells.Last().GetString());
}