How to check if a column of datatable(Excel) contains a value and highlight it?

Hello everyone,

I have a data table with only one row and a lot of columns. I want to highlight if any of the columns contain a value i.e. I want to highlight the cell if the cell is not blank.

Problem:

In the above example only Uni name is present, I want to highlight that cell


.
The value could be present in any of the other columns as well. I want to highlight the cells in which a value is present.

Thank you.

In an excel application scope, use “lookup range” to get the cell ID, then you can use set range color to change that cell ID.

Now, this will only highlight the first instance. Maybe loop though with a ‘for every row’?

@NervYerem Thanks for the response

I actually want to highlight all the cells which are not blank. I do not know which cell would contain values. In the above example problem, my datatable contains only one value. There could be two or more values also, I want to highlight all of the them, see the image below for reference.

maybe you can read the range, then use a for each row, and check if the row is empty or it has value, if it has value then use the set range color in this particular item, if its empty just ignore it

regards!

@fernando_zuluaga Thanks for the response

I am unable to understand how to get the cell address in which the value is present and I need to highlight that cell with a colour.

Hi @Pruthvi.G ,

Have you tried using the Set Range Color Activity yet?
It can only be used within an Excel Application Scope though.
image

Kind Regards,
Ashwin A.K

HI @Pruthvi.G

You can try with Lookup DataTable

Try this expression

DtMaster.AsEnumerable.Select (Function(x) x("University").ToString.Trim.Contains("IIT Madras")).ToArray()

Have a look on the thread for Highlighting

Regards
Gokul

hey

i made it for you

check the xaml
test.xaml (13.1 KB)

hope it help you

regards!

1 Like

@fernando_zuluaga

Thank you so much for your help. That should work.

1 Like

Which method did you use? (Can’t download xaml files to review)

hey

check it


image

regards!

1 Like

Nice! That’s nice and clean.

1 Like

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