Dear MrExcel community,
I would like to color the cells in my sunburst chart in the same color like the cells inside a table from another workbook.
It seems that programming a sunburst might not have too many threads. Nevertheless, I'm sure and I hope you will help me finding a proper solution
The cells in the table are to be read in columns, while the same values in the sunburst are to be read in one circle. Vice versa, one row in the table is to be read from the center to the outer part of the sunburst.
Here is a piece of a code, I wrote, to color the second circle (first circle is the center of the sunburst chart).
Please feel free to ask for further information (I also can send you the files) at any time - I will reply as soon as possible.
Many thanks!!
I would like to color the cells in my sunburst chart in the same color like the cells inside a table from another workbook.
It seems that programming a sunburst might not have too many threads. Nevertheless, I'm sure and I hope you will help me finding a proper solution
The cells in the table are to be read in columns, while the same values in the sunburst are to be read in one circle. Vice versa, one row in the table is to be read from the center to the outer part of the sunburst.
Here is a piece of a code, I wrote, to color the second circle (first circle is the center of the sunburst chart).
Code:
Option Explicit
Dim thisworkbook As Workbook
Dim i As Integer
Dim c As Integer
Dim z As Integer
Dim farbe As Integer
Dim Urtabelle As worksheet
dim wkbdaten as workbook
Dim rng As Range
Sub sun()
On Error GoTo FEH
'
With Application
.ScreenUpdating = False
.EnableEvents = False
.Calculation = xlCalculationManual
End With
'
Workbooks.Open "L:\...\name.xlsm"
Set wkbDaten = Workbooks("table.xlsm")
Set Urtabelle = wkbDaten.Sheets("table-SHEET")
FEH:
With Application
.ScreenUpdating = True
.EnableEvents = True
.Calculation = xlCalculationAutomatic
End With
'How many circles do we have?
c = 0
For z = 1 To 50
If Cells(z, 1) > 0 Then
c = c + 1
End If
Next z
For i = 6 To c
'color the cells in the second circle inside of the sunburst
farbe = table.Cells(i, 2).Interior.Color
If table.Cells(i, 2).Value <> Empty Then
ThisWorkbook.Sheets("Tabelle6").FullSeriesCollection(2).Points(i).Select
With Selection.Format.Fill
.Visible = msoTrue
.ForeColorindex = farbe
.Transparency = 0
.Solid
End With
End If
End Sub
Please feel free to ask for further information (I also can send you the files) at any time - I will reply as soon as possible.
Many thanks!!