Free Support Forum -

How to get rows count by range defined in Excel

Hi !

Please guide me for getting rows count with respect to range defined in Exce.

For Ex:-

I have excel sheet, and in that Range_1 is defined. Now I want to retrive rows

fot the particular range in C#.

Thanks a lot !


Thanks for considering Aspose.

Please check the following code for your reference:

Range range1 = workbook.Worksheets.GetRangeByName("Range_1");
int totalcols = range1.ColumnCount;
int totalrows = range1.RowCount;
int frow = range1.FirstRow;
int fcol = range1.FirstColumn;
Thank you.