color scales and donut charts

Weegie5

New Member
Joined
Mar 24, 2011
Messages
2
Here is an issue that has been bugging me for several months now. I have a table of data to which I applied conditional formatting color scales: the cell fill color transitions from blue to yellow to red as the values in the table go from lowest to highest.



The table has 36 columns in it and 10 rows. I want to plot the data in a donut chart with 36 "slices" in 10 concentric circles. (The top row of the table would be the center of the donut and the bottom row would be the outermost donut. 0 would be the top of the circle, 90 would be @ 3 o'clock, 180 at the bottom, and so on.)



All the slices need to be the same width, as shown, but ultimately I want the colors of the donut chart to match the color scale of the table. I'd also like to be able to view the values for each cell, even if that is in a separate view/version of the donut chart.

I'm currently stuck trying to determine the RGB color code of each of the cells in the table. I've read through the VB functions explained at http://www.cpearson.com/excel/colors.aspx and none of that appears to be what I need.

Any assistance at all would be greatly appreciated!
 

Some videos you may like

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
This will return the RGB color of the active cell

Code:
Sub ShowColour()
Dim RGBColour As String, R As Integer, G As Integer, B As Integer
RGBColour = Right("000000" & Hex(ActiveCell.Interior.Color), 6)
R = WorksheetFunction.Hex2Dec(Right(RGBColour, 2))
G = WorksheetFunction.Hex2Dec(Mid(RGBColour, 3, 2))
B = WorksheetFunction.Hex2Dec(Left(RGBColour, 2))
MsgBox "RGB" & vbTab & R & ", " & G & ", " & B & vbCrLf & _
    "Color" & vbTab & ActiveCell.Interior.Color & vbCrLf & _
    "Index" & vbTab & ActiveCell.Interior.ColorIndex, vbInformation
End Sub
 

Weegie5

New Member
Joined
Mar 24, 2011
Messages
2
VoG, thanks for the quick reply.

This will return the RGB color of the active cell
Unfortunately that returns the same values for any of the cells in the table. It says
Code:
RGB         255, 255, 255
Color       16777215
Index       -4142
regardless of the color. And the cells certainly aren't white.

I suspect this is because it is a color scale applied to the table and not more simple conditional formatting, but I'm hardly the expert here...
 

Watch MrExcel Video

Forum statistics

Threads
1,109,518
Messages
5,529,308
Members
409,862
Latest member
lbisacca
Top