Home > database >  Different colors text in a single cell
Different colors text in a single cell

Time:10-06

Here i need to print var32 alone in a different color which is in red. I tried with the below line but its not working, can someone pls guide in this. Thanks in Advance

Range("BH" & kk).Value.ActiveCell.Characters(Start:=11, Length:=14).Font.ColorIndex = 3

For kk = 2 To RowsCount
If (Range("BI" & kk).Value = "yes" And Range("BJ" & kk).Value = "yes" And Range("BK" & kk).Value = "yes" And Range("BL" & kk).Value = "yes") And (Range("BM" & kk).Value = "yes" And Range("BN" & kk).Value = "yes" And Range("BO" & kk).Value = "yes" And Range("BP" & kk).Value = "yes") And (Range("BQ" & kk).Value = "yes" And Range("BR" & kk).Value = "no" And Range("BS" & kk).Value = "yes" And Range("BT" & kk).Value = "yes") Then
   Range("BH" & kk).Value = var12 & "," & var22 & "," & var32
   Range("BH" & kk).Value.ActiveCell.Characters(Start:=11, Length:=14).Font.ColorIndex = 3
EndIf
Next kk

CodePudding user response:

Range("BH" & kk).Characters(Start:=11, Length:=14).Font.Color=vbRed
  • Related