如何检查是否一个Excel范围是在C#空
我要检查,如果一个范围(单元格行*列)使用C#是空的。我可以通过细胞穿越,但任何bettter和更快的方式吗?任何方法从选定/活动单元格和行和列的数量得到范围?
I want to check if a range (cells in row * column) is empty using C#. I can traverse through cells, but any bettter and faster way ? Any method to get range from selected/active cell and number of rows and column ?
我假设的Excel.WorksheetFunction.CountA 工作不仅与表,但与任何Range参数:
I suppose that Excel.WorksheetFunction.CountA works not only with sheets but with any Range argument:
使用COUNTA计数包含在一系列
或阵列数据单元的数目
Use CountA to count the number of cells that contain data in a range or array.
一个值是任何类型的信息,包括错误值和空
文本()。值不包括空单元格。
A value is any type of information, including error values and empty text (""). A value does not include empty cells.
如果一个参数是一个数组或引用,仅用于该数组或
的参考值。空数组或
参考被忽略单元格和文本值。
If an argument is an array or reference, only values in that array or reference are used. Empty cells and text values in the array or reference are ignored.