How to check if an Excel Range is empty in C#

后端 未结 1 1842
日久生厌
日久生厌 2021-01-18 12:28

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/ac

相关标签:
1条回答
  • 2021-01-18 12:54

    I suppose that Excel.WorksheetFunction.CountA works not only with sheets but with any Range argument:

    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.

    0 讨论(0)
提交回复
热议问题