Dr. Demento
Well-known Member
- Joined
- Nov 2, 2010
- Messages
- 618
- Office Version
- 2019
- 2016
- Platform
- Windows
Has anyone else noticed that the color schemes for Tables created in 2010 are different than those in 2013? From what I can see, the grey and blue (first and second styles) in each color grouping (1-7, 8-14, 15-21, etc) are the same; the remainder are a little off (2010 red vs 2013 orange = Light10) but some are really off (2010 green vs 2013 grey, Light11).
More importantly, any recommendations on how I can update workbooks created in 2010 to the 2013 color schema?
Thanks y'all.
Here is some code to create the table color schema; as far as I can tell, the difference is the version the workbook was created under.
More importantly, any recommendations on how I can update workbooks created in 2010 to the 2013 color schema?
Thanks y'all.
Here is some code to create the table color schema; as far as I can tell, the difference is the version the workbook was created under.
Code:
Sub styles_listGrid_drD()
' ~~ Array of examples of TableStyles
' [URL]http://www.mrexcel.com/forum/excel-questions/916251-array-examples-tablestyles.html#3[/URL]
Const maxDepth As Long = 25
Const strtCell As String = "B2"
Dim Down As Long
Dim Across As Long
Dim tblStyl As TableStyle
Dim rng As Range
Dim i As Long
With ActiveWorkbook.Worksheets.Add
For i = 0 To 143
Set tblStyl = ActiveWorkbook.TableStyles(i + 1)
Down = (i Mod maxDepth)
Across = Int(i / maxDepth)
Set rng = .Range(strtCell).OffSet(Down * 4, Across * 2).Resize(3, 1)
With .ListObjects.Add(xlSrcRange, rng, , xlYes)
.TableStyle = tblStyl
.ListRows(1).Range.Cells(1, 1).Value = i + 1
.HeaderRowRange.Columns(1) = tblStyl.Name
End With
Next i
.UsedRange.Columns.AutoFit
End With 'ActiveWorkbook
End Sub