Sorry for maybe unintelligible title but i cant find out how to write this better.
I've got Excel VBA code that transforms the sheet from Excel for a version to print in a Word. The problem is that when a specific cell in a row in Excel is red colour or is equal to "ENG_AT" text I need to color content of cell which will be printed.
Here you got the original working code sample.
ElseIf Not IsEmpty(calArray(i, 3)) And IsEmpty(calArray(i, 2)) Then
'item
styleName = "N1"
headerText=calArray(i, 12)
.Rows(t).Borders(-3).LineStyle = 7
calArray(i,12)
is cell that is going to print.
And this is part where I tried to add my statement
ElseIf Not IsEmpty(calArray(i, 3)) And IsEmpty(calArray(i, 2)) And calArray(i, 16) = "ENG_AT" Then
'item
styleName = "N1"
Dim Text2 As String
Text2 = UCase(calArray(i, 12)
Text2.Interior.Color = RGB(0, 0, 250)
headerText = Text2
'.Font.Underline = True
.Rows(t).Borders(-3).LineStyle = 7
All I've done is only to uppercase a letters, rest is not working. I would be really happy if someone could explain to me how can I change color of destination cell in Word table or just underline this text.
Thank you in advance for help.