View Single Post
 
Old 01-06-2016, 06:36 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,375
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

As indicated in post #7, you can't just input the RGB values into a cell that way. You need to either input them as the number value of the colour, as a 9-digit number (which you could then parse mathematically into the R, G & B components), using code like:
Code:
If Split(xlFClr, "|")(i) <> "" Then .Color = RGB(INT(Split(xlClr, "|")/1000000), INT(Split(xlClr, "|")/1000000) mod 1000, Split(xlClr, "|") mod 1000)
or as a delimited string (which you could then parse via Split into the R, G & B components). You can't use commas as the delimiters, as Excel will start turning them into plain numbers, and adding spaces into the mix along with the commas still doesn't help with the parsing. I'd suggest inputting the R, G & B components as space-separated values (e.g. 127 127 127), which you could then process using code like:
Code:
If Split(xlFClr, "|")(i) <> "" Then .Color = RGB(Split(Split(xlClr, "|")(i), " ")(0), Split(Split(xlClr, "|")(i), " ")(1), Split(Split(xlClr, "|")(i), " ")(2))
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote