How to set red colour to complete row text when column "Results" contains failed?

Please see provided screenshot.

Regards,

JM

1 Like

This gives colour to complete cells, i just want for text.
image

image
this complete row is coloured, but i only want text not cells

@MitheshBolla

Please see the attached link for an explanation on how to solve this problem with conditional formatting within Excel.

If you’re adamant about solving this issue with UiPath the easiest solution would be to create a VBA script and then running it with UiPath (How to change the font color in the excel cell - #5 by AndersJensen)

Regards

JM

1 Like

Hi @MitheshBolla ,

Could you Check the post Below :

Once this is working, we can adopt the method of finding the row indices which are required to be colored.

1 Like

hi bro,
I had took this invoke vba code and placed it in my C# project .
i had ran the code , there is no error but still it is not hilighting the Font for paticular cell.

Hello @MitheshBolla

You can use the Format cell activity. This can be used to change the Font color or cell color.

1 Like

With this i am able to fill colour in cell.

My requriment is to just hilight font . not cell

I think you can modify the font color as well as font style also using this activity.

1 Like

We cant change font colour with that activity

Yes, you can use that activity to meet your requirement.

1 Like

But not font colour.

@MitheshBolla Please check the below screenshot. Like this way you can do.

@MitheshBolla
VBA Solution

  1. copy below code to text file e.g. vba.txt
Function highlightCellRed(columnLetter as string, rowNumber as integer, sheetName as string) 
    Activeworkbook.Sheets(sheetName).activate
    Range(columnLetter & cstr(rowNumber)).Select
    With Selection.Font
        .Color = vbRed
        '.TintAndShade = 0
    End With
    Activeworkbook.Save
End Function
  1. in excel application scope use invoke VBA activity to call the macro
    the entry method parameters are {column letter, row number, sheet Name}
    e.g. {"A",1,"Sheet1"}
1 Like

with this can i add font colour to whole row?

1 Like

yes but its troublesome, if you want to highlight whole row, do this instead

  1. add below code to vba.txt
Function highlightCellRedWholeRow(rowNumber As Integer, sheetName As String)
    ActiveWorkbook.Sheets(sheetName).Activate
    Rows(CStr(rowNumber) & ":" & CStr(rowNumber)).Select
    With Selection.Font
        .Color = vbRed
    End With
    ActiveWorkbook.Save
End Function
  1. use invoke VBA in excel application scope, set function name = highlightCellRedWholeRow,
    entryMethodParameters = {rowNumber, SheetName}
    e.g. {2, Sheet1} to highlight row 2 in sheet1
1 Like

image
how to write in c#

new object[]{rowCount,eachSheetName}

This had worked bro , thanks a lot.

In excel Based on condition i added font colour for complete row, solution provided by @jack.chan .
And also enable macros in excel.

1 Like

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