LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Chart Title color can't be duplicated (also series color)

Hi,

[for Excel 2010]
i tried to record the properties of selected chart and duplicate to other charts in sheet.
however, the applied color is not match is selected chart. Any solutions and why? Thanks.


Sub MyChartFormat()

Application.ScreenUpdating = False
Dim Cnt As Long
Dim Arr_ChtPer()

Cnt = ActiveSheet.ChartObjects.Count

'Recording

ReDim Arr_ChtPer(110)

'ChartTitle

ActiveChart.ChartTitle.Select
With Selection
Arr_ChtPer(1) = .Left
Arr_ChtPer(2) = .Top
End With

With Selection.Format.TextFrame2.TextRange.Font
Arr_ChtPer(3) = .NameComplexScript
Arr_ChtPer(4) = .NameFarEast
Arr_ChtPer(5) = .Name
Arr_ChtPer(6) = .Size
Arr_ChtPer(7) = .Bold
End With

With Selection.Format.TextFrame2.TextRange.Font.Fill
Arr_ChtPer(8) = .Visible
Arr_ChtPer(9) = .ForeColor.ObjectThemeColor
Arr_ChtPer(10) = .ForeColor.TintAndShade
Arr_ChtPer(11) = .ForeColor.Brightness
Arr_ChtPer(12) = .ForeColor.RGB = RGB(255, 0, 0)
Arr_ChtPer(13) = .Transparency
End With

With Selection.Format.Fill
Arr_ChtPer(14) = .Visible
Arr_ChtPer(15) = .ForeColor.RGB
Arr_ChtPer(16) = .Transparency
End With


'Duplicating
i = 1
Do Until i Cnt

ActiveSheet.ChartObjects(i).Activate

ActiveChart.ChartTitle.Select
With Selection
.Left = Arr_ChtPer(1)
.Top = Arr_ChtPer(2)
End With

With Selection.Format.TextFrame2.TextRange.Font
.NameComplexScript = Arr_ChtPer(3)
.NameFarEast = Arr_ChtPer(4)
.Name = Arr_ChtPer(5)
.Size = Arr_ChtPer(6)
.Bold = Arr_ChtPer(7)
End With

With Selection.Format.TextFrame2.TextRange.Font.Fill
.Visible = Arr_ChtPer(8)
If Arr_ChtPer(8) < -1 Then .ForeColor.ObjectThemeColor = Arr_ChtPer(9)
.ForeColor.TintAndShade = Arr_ChtPer(10)
.ForeColor.Brightness = Arr_ChtPer(11)
.ForeColor.RGB = Arr_ChtPer(12)
.Transparency = Arr_ChtPer(13)
End With

With Selection.Format.Fill
.Visible = Arr_ChtPer(14)
.ForeColor.RGB = Arr_ChtPer(15)
.Transparency = Arr_ChtPer(16)
End With

i = i + 1
Loop

end sub


br
Danny
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change the color of all series in an excel chart in one go. Marielle Charts and Charting in Excel 2 May 3rd 23 07:45 PM
Combining Multiple-Color Data Series into One Bar Chart JSF Charts and Charting in Excel 0 September 24th 08 01:41 AM
How to get Excel to use a custom RGB color in a chart series? Drew Lettington Excel Programming 5 November 2nd 06 09:23 AM
help me to change the color of two series in a chart into the same KhanhNguyen Charts and Charting in Excel 2 April 21st 06 04:48 AM
How to change the color of all series in an excel chart in one go. Mz2 Charts and Charting in Excel 1 January 20th 05 01:07 AM


All times are GMT +1. The time now is 02:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"