How to code CMYK numbers into an Excel VBA procedure

I have CMYK numbers to use in an excel worksheet.
How can I code CMYK numbers into range("a1").font.color?
brothertruffle880Asked:
Who is Participating?
 
Neil FlemingConnect With a Mentor Independent consultantCommented:
Code below performs an approximate conversion of CMYK to RGB. It's not perfect though. See original discussion (where I found this) at https://stackoverflow.com/questions/10690125/coloring-cells-in-excel-with-cmyk-cell-values

Function CYMK2RGB(c As Integer, y As Integer, m As Integer, k As Integer) As Long
Dim R As Integer
Dim G As Integer
Dim B As Integer
Dim colors As Integer

colors = 255 * (100 - k) / 100
R = colors * (100 - c) / 100
G = colors * (100 - m) / 100
B = colors * (100 - y) / 100

CYMK2RGB = RGB(R, G, B)
End Function

Open in new window

0
 
brothertruffle880Author Commented:
Thanks Neil!!!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.