Filter Excel Sheet and Write Cell Based on Filter

Hi,

I am trying to find a way to filter an excel sheet with over ten thousand rows. I tried a ‘For Each’ initially, but it was very time consuming.

I am trying to filter the excel sheet and write a value in a “Status” column for the current rows displayed in the filtered sheet. I need to keep all ten thousand rows, and it should be unfiltered after the end of the sequence.

*I am able to do this in StudioX, but do not know how to code in Studio. Also able to create a VBA macro.

Any help is greatly appreciated.

Hi @carlos_avila

Can u show ur requirements by providing a screenshot of what u need at output

1 Like

Hi @NIVED_NAMBIAR

Please see attachment as a reference.

Each person name Charles and Michael, should have the color “Red” assigned under column B (Color). Every cell highlighted yellow in this case should have the word “Red”.

I showed a picture how I was able to do this in StudioX. I am trying to do this in Studio.

1 Like

Hi @carlos_avila check this workflow

text_file.zip (1.4 MB)

Hope it helps you

Regards

Nived N

Happy Automation

Hi,

Please ignore anything about color. I was highlighting for the purpose to show the example of the cells that will need to be updated with the word “Red”.

I tried an if in my for each activity initially but with over Ten thousand rows, it is taking a long time to execute because going through each row.

I am able to do this in StudioX easily , but trying to learn how to do this in Studio. Thank you.

@carlos_avila
you can try the below code in “Invoke Code " Activity by modifying it with your required conditions
dataTable.Select(”[Status]=‘YELLOW’ ").ToList().ForEach(Sub(row) row(“Status”)=“RED”)

1 Like

Hi,

How would I go about this with if Name = Charles or Michael, the write to Cell the word “Red” under “Color” column.

Thank you.

Hi @carlos_avila,
please try with the below code
dataTable.Select(”[Status]=‘YELLOW’ AND( [name]=‘Charles’ OR [name]=‘Michael’)").ToList().ForEach(Sub(row) row(“Status”)=“RED”)

Hi ,

I want to filter column based on value and highlight the only cell from that column.
Eg if Column A has 5000 rows and suppose there is value “3” or “4” in particular cell so need to highlight only those cells from column A not whole row but only cell which contains “3” or “4” value.
Is there any vb code for filtering the columnn and at the same time highlighting the cell ?
From UiPath studio activity it will take large amount of time as my rows count in Excel will be around 80-90k…