Only uipath packages recommended.not custom packages .
This gives colour to complete cells, i just want for text.
this complete row is coloured, but i only want text not cells
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
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.
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.
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.
We cant change font colour with that activity
Yes, you can use that activity to meet your requirement.
But not font colour.
@MitheshBolla
VBA Solution
- 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
- 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"}
with this can i add font colour to whole row?
yes but its troublesome, if you want to highlight whole row, do this instead
- 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
- use invoke VBA in excel application scope, set function name = highlightCellRedWholeRow,
entryMethodParameters ={rowNumber, SheetName}
e.g.{2, Sheet1}
to highlight row 2 in sheet1
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.