Hiding Rows / Filtering Data

I’m trying to hide rows and having some difficulty. I know that UIpath doesnt have a hide row feature, but has anyone discovered a work around for this?

Each time my report is generated it will have a different number of rows. I would like to hide all the data, and just have the “sum” and the second to last row hidden. I’m attempting to create a filter using the "first / last data row’ → save for later (Last row - 1). But Im stuck at the moment and havent had much success. Has anyone had any success doing this (filtering out all the rows except for the last two )?

Thank you in advance for your help!


did you try with that?


Hi @ldavis ,

If you are trying to hide all rows except for the last two, then could you give this workflow a try?


This is the input required to detect the row indexes to hide.

HideAllRowsExceptLastTwo.xaml (7.9 KB)

Kind Regards,
Ashwin A.K

Hi @ldavis ,

Check the Workflow Below :
Excel_HideRows_BasedOnIndexRange.xaml (8.7 KB)

We also Require to add a Package to the Workflow :

We can use the Interop.Excel to get the Rows hidden. We also would require to get the Table Row and Column Details, Hence, we use a Read Range and get the Datatable.

Below is the c# Code used in the Invoke Code :

	Microsoft.Office.Interop.Excel.Application app = new Microsoft.Office.Interop.Excel.Application();
	var wb = app.Workbooks.Open(in_FilePath,3,false,5); 

	Microsoft.Office.Interop.Excel.Worksheet workSheet = (Microsoft.Office.Interop.Excel.Worksheet)wb.Sheets[in_SheetName];
	workSheet.Range[workSheet.Cells[in_StartRowIndex+2,1],workSheet.Cells[in_EndRowIndex+2,in_DT.Columns.Count]].EntireRow.Hidden =true;
catch(Exception e)
	out_Exception = e;
	Console.WriteLine(e.Message.ToString()+" "+e.Source.ToString());

Let us know if this doesn’t help or if you have already got another solution.