I want to update the value of cell in yellow color to zero


1 Like

Please use “Set Range Color” activity

1 Like

I want to update the cell value with zero

1 Like

Sample.xaml (8.2 KB)
You can use ‘Get Cell Color’ activity to get color
Then use if condition to update cell value


I assume you want to look through every cell and change the values to zero?

You need an excel scope and read range activity to generate your datatable.
Then use a ‘for each’ activity to look at every row, from which you can look at every column index with an IF check and change the value to 0 if it finds a number.
Once the check has completed, write the datatable back into the excel file.

If the column count is not known, you can use YourDT.Columns.Count -1 to determine the max. index number. Then you can add a counter within the ‘for each’ activity to run through every column from index 0 to YourDT.Columns.Count -1.

If there is a color check, @Donglin_Lee 's solution will work.

1 Like

for the column and row how to keep the counter can you tell???

1 Like

If you have all the checks within a ‘for each row’ activity, you can do the following

Before ‘for each row’ activity:

  • Assign ‘col counter’ to 0

During ‘for each row’ activity:

'Do While activity for ‘col count’ <> YourDT.Columns.Count - 1

  • IF check on column index for cell value > 0 and then the resulting activities of true and false
  • ‘col counter’ = ‘col counter’ + 1


1 Like

can you share the code or screen shot ??

1 Like

cell Range i was getting this error

1 Like

Screenshot above. If you are still lost about what I have done, I’ll strongly recommend going to the UiPath Academy. You will learn many of the DataTable and Excel related activities and codes from the Foundation course.

1 Like

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