Filter data and set color to filtered data(dynamically) keeping it in another sheet in same workbook

Let’s say, I have an excel file in which name, age columns are present. if I have to filter the age (>30 and <40) and keep it in another sheet of the same workbook, and color the filtered age as green only dynamically, using for each and if activities (without using data table filter activity), how can I do it?
sample file.xlsx (10.6 KB)

Hi,

To filter the data table we have FilterDataTable activity and for setting the color use set range Color activity

Please try those activities and let us know if you have any queries.

HAPPY AUTOMATION !!!

@ydash999

Check as below

image

Returns below result

image

For Colouring the column you can use below

Use Assign activity and write as SheetIndex = datable.Rows.Count

Now use Excel Application Scope activity and inside that and use Set Range Color activity

Hope this helps you

Thanks

hii.did you keep same variable dts for assign and read data table? what did you do after assign activity. i am unable to get filtered data in another sheet

@ydash999

Yes, dts is the same which I used the Read Range

After assign you can place write range activity I just checked in the locals only

Share your workflow screenshot if your are unable to get the filtered datatable

check the expression here

dts.Select("[age] > 30 AND [age] < 40 ").CopyToDataTable

Thanks

yes done bro.thankss. now how to dynamically set green color to my filtered data only in that sheet?

@ydash999

Check below to color the column, Let’s say A column we need to color, follow below

image

This will always dynamic according to the Rows of the datatable

This will help you

Thanks

1 Like

thankss a lot. it was very helpful brother. can you tell me how can we achieve that using for each row and if activities?what would be more time efficient?

@ydash999

For difference of For Each row and others you can refer below

UseCase with ForEach

Use Case with Filter Datatable

Use Case without For Each or Filter Datatable

Hope this will help in understanding

Thanks

1 Like

thankss a lot

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.