如何使用c#获取excel中当前活动的行号? [英] How to get the current active row number in excel using c# ?

查看:531
本文介绍了如何使用c#获取excel中当前活动的行号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取excel中的行号?我的excel表中有超过300行,我需要在整数变量中得到行号59?怎么做 ?我只需要行号值而不是单元格内的值?

How to get the row number in excel ?? I am having more than 300 rows in my excel sheet and i need to get the row number 59 in an integer variable ??? How to do it ? I need only row number value not the values inside the cells ?

推荐答案

您可以使用ExcelPackage(EPPlus.dll版本3.0.0.2)获取行数和列数下面:



var rowCnt = worksheet.Dimension.End.Row;

var colCnt = worksheet.Dimension.End.Column;









http://stackoverflow.com/questions/12276745/find-the-last-used-row-in -excel-with-c-sharp [ ^ ]



问候,

Praveen Nelge
You can get the row and column count using ExcelPackage (EPPlus.dll version 3.0.0.2) as below:

var rowCnt = worksheet.Dimension.End.Row;
var colCnt = worksheet.Dimension.End.Column;


OR

http://stackoverflow.com/questions/12276745/find-the-last-used-row-in-excel-with-c-sharp[^]

Regards,
Praveen Nelge


这篇关于如何使用c#获取excel中当前活动的行号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆