Fastest way to count rows in an excel sheet?

Hey all, currently I need to ensure that the number of rows after filtering isn’t zero.

image

This is what I’m currently doing and it works… but slowly (Due to the amount of rows). It takes about 4ish min to run just this if statement, and I need to do about 20 if statements! Any quicker ways to do so?

Did you test using Read Range Workbook instead and counting the rows from dt_output?

This activity:
image

Also do you by any chance use Excel with it being visible? If yes try to disable that (in the Excel scope / use excel file)

Hi @David_Hernandez2

Use the workbooks activity to read the range from your excel, then just use the method

yourDT.RowCount > 0

it should be quicker, Regards

Hi,

Did you filter your excel using ‘Filter Datatable’ in any case? If yes, you could use this in your if to ensure that the number of rows after filtering isn’t zero:

dt_Filtered.Rows.Count <> 0

Regards,