加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

如何在C#中检查Excel范围是否为空

发布时间:2020-12-15 04:26:55 所属栏目:百科 来源:网络整理
导读:我想使用C#检查范围(行*列中的单元格)是否为空.我可以遍历细胞,但任何更好的方式和更快的方式?从选定/活动单元格获取范围以及行数和列数的任何方法? 解决方法 我想 Excel.WorksheetFunction.CountA不仅可以使用工作表,还可以使用任何Range参数: Use Count
我想使用C#检查范围(行*列中的单元格)是否为空.我可以遍历细胞,但任何更好的方式和更快的方式?从选定/活动单元格获取范围以及行数和列数的任何方法?

解决方法

我想 Excel.WorksheetFunction.CountA不仅可以使用工作表,还可以使用任何Range参数:

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.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读