How to count the row and column in a excel

I need the answer for number of rows and columns in a excelsheet.If anyone knows share your answer…

advance thanks…


Use a Read Range to get all the information from the Excel File and then assign to a variable the count of columns and rows.


rowsCount = datatableExcel.Rows.Count
columnsCount = datatableExcel.Columns.Count

Here’s a example done: excelCounts.xaml (8.0 KB)

Hope It Helps!



Hello. I want to ask if how do you compare data retrieved from an excel spreadsheet to another spreadsheet


1 Like

Thanks Lucas.Pimenta :slight_smile:

1 Like

Great! Thank you Lucas Pimienta.

1 Like

Hello and thanks to Lucas for an excellent answer.

Anyways my problem is a little different. My excel workbook has empty rows and I would need to get the information what’s the lowest cell where my workbook has information. Eg. when I use rowsCount = datatableExcel.Rows.Count in assign, I get 100 but my workbook has data on the row 153 as there are many empty rows in between.

Thanks in advance,

I found an answer and I paste it here if someone else runs to the same problem.

1 Like

Can you use the Read Range activity in Studio X or is this exclusively in Studio? I have Studio X and I don’t see Read Range as an option. If it is not available, how can I count rows in excel using Studio X?