Sub Test()
MsgBox VBA_Hex_To_RGB("[COLOR=#ff0000]H0080C0FF[/COLOR]")
End Sub
Function VBA_Hex_To_RGB(hColor As String) As String
Dim iRed, iGreen, iBlue
'Convert HEx to RGB
hColor = VBA.Replace(hColor, "#", "")
hColor = VBA.Right$("000000" & hColor, 6)
iBlue = VBA.Val("&H" & VBA.Mid(hColor, 1, 2))
iGreen = VBA.Val("&H" & VBA.Mid(hColor, 3, 2))
iRed = VBA.Val("&H" & VBA.Mid(hColor, 5, 2))
'Return RGB Code
VBA_Hex_To_RGB = "(" & iRed & "," & iGreen & "," & iBlue & ")"
End Function