CSS in VBA

Hi, I have code and it’s work OK:


 Email_Body = Email_Body & "<BR>" & _
            "<ol><li style=""list-style-type: disc""><B>" & Incident_Sev_3_WS.Cells(i, 6).Value & " - " & Incident_Sev_3_WS.Cells(i, 5) & "</B>" & _
            "<ul><li style=""list-style-type: circle""><B>Date: </B>" & Incident_Sev_3_WS.Cells(i, 1).Value & "</li>" & _
            "<li style=""list-style-type: circle""><B>Businesses Affected: </B>" & Incident_Sev_3_WS.Cells(i, 22).Value & "</li>" & _
            "<li style=""list-style-type: circle""><B>Regions Impacted: </B>" & Incident_Sev_3_WS.Cells(i, 15).Value & "</li>" & _
            "<li style=""list-style-type: circle""><B>Business Impact: </B>" & Incident_Sev_3_WS.Cells(i, 23).Value & "</li>" & _
            "<li style=""list-style-type: circle""><B>Incident Description: </B>" & Incident_Sev_3_WS.Cells(i, 4).Value & "</li>" & _
            "<li style=""list-style-type: circle""><B>Root Cause Category: </B>" & Incident_Sev_3_WS.Cells(i, 16).Value & "</li>" & _
            "<li style=""list-style-type: circle""><B>Contact: </B>" & Incident_Sev_3_WS.Cells(i, 8).Value & "</li>/ul></li></ol>" & _
            "<B><font: color:"" red"">" & Incident_Sev_3_WS.Cells(i, 7).Value & "</B>"

Now I want to last line:

 "<B><font: color:"" red"">" & Incident_Sev_3_WS.Cells(i, 7).Value & "</B>"

format with font color RED.

please help

Hi,

Do it like this:


"<b style=""color:#f00000"">" & Incident_Sev_3_WS.Cells(i, 7).Value & "</b>"

You’ll have to work out if all the double quote marks are all correct.

thanks!

I have already did it like:


"<font color=""RGB(255,33,170)""><B>" & Incident_Sev_3_WS.Cells(i, 7).Value & "</B></font>"

Yes but that’s not the best way to do it because the font tag is deprecated in strict doctypes and should never be used these days in any page (along with the deprecated attributes you have used). It is a redundant tag in that context anyway anyway as you have a perfectly good element to use already so there simply is no need to add a useless and deprecated tag. :slight_smile: