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!
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
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
 
Upvote 0
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...
 
Upvote 0

Forum statistics

Threads
1,214,905
Messages
6,122,175
Members
449,071
Latest member
cdnMech

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top