I’m looking for a way possibly using VBA to apply a cell’s fill value by looking at specified fields in the same record. This would be a sample tab delimited Excel sheet:
BEGIN_DATA_FORMAT
SampleID SAMPLE_NAME CMYK_C CMYK_M CMYK_Y CMYK_K LAB_L LAB_A LAB_B
BEGIN_DATA
1 1 100 0 0 60 34.16 -19.52 -27.46
2 2 100 100 0 60 22.02 6.27 -23.25
3 3 100 0 0 0 54.56 -31.12 -45.29
END_DATA
Fields 3-6 each contain the values for CMYK respectively. I’d like to apply a cell background fill to field 1 by parsing each record for the combined CMYK values as a starting point.
Conversion to RGB or HSL may need to be done initially unless there’s a backdoor method to set CMYK values in the Excel/Windows color picker.
this will give you the RGB from the CYMK in your data:
using
range("A1").Interior.Color=cymk2rgb(...)will set the color – note it’s not going to be an exact match, as CYMK is subtractive, and RGB is additive. this site: http://www.printernational.org/rgb-versus-cmyk.php has more details comparing the two.