Using Format Cells activity in Modern excel

Hello,
i’m trying to iterate through a spreadsheet using excel process scope. i want to look at a particular column using the if statement:
CurrentRow.ByField(“SLA Breached”).ToString.Trim = “Yes”

if it equals “Yes”, i want to change the font to red. Is there a simple logic to add to the source field to update the particular cell? i’m having issues determining what to write.

Hi @chris.dease

Can you try the below

Output:

Regards,

Don’t use ByField here. Just use CurrentRow(“SLA Breached”).ToString.Trim

You use ByField to get the range:

CurrentRow.ByField(“SLA Breached”).Address

Put that into the Source/Range of your Format Cells activity.

You don’t know if their column is A. Shouldn’t hard-code it. You can extract the cell address with…

CurrentRow.ByField(“Column Name”).Address

@postwick,
i tried @lrtetala way and it worked when i hard coded the column “D” (in my spreadsheet). i tried your way as well, but i’m getting error: BC30512 disallows implicit conversions from String to IReadRangeRef. Any suggestions?

Oh, sorry, I missed part of the expression. It should be:

Excel.Sheet(“your sheet name”).Range(CurrentRow.ByField(“SLA Breached”).Address)

This is working! Thanks for you help!!

1 Like

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