Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 3
Default Another Pivot Chart Autoformating Question

I have read through the other posts; but I still need some additional help
since I do not have Macro or VBA experience.

I am looking for a easy solution to reset all the pivot charts to my
formatting as noted below (from a recorded Macro that didn't work) after a
data refresh. There are about 20 tabs in the workbook with a pivot table and
chart on each tab. A manual macro that works on all tabs or an auto run macro
that works after a refresh is what I'm looking for. Any suggestions?

Thanks in advance,

Sub FormatPivotChart()
' FormatPivotChart Macro
'
ActiveSheet.ChartObjects("Chart 3").Activate
ActiveChart.SeriesCollection(1).Select
With Selection.Border
.Weight = xlThin
.LineStyle = xlAutomatic
End With
Selection.Shadow = False
Selection.InvertIfNegative = False
With Selection.Interior
.ColorIndex = 9
.Pattern = xlSolid
End With
With ActiveChart.ChartGroups(1)
.Overlap = 100
.GapWidth = 30
.HasSeriesLines = False
.VaryByCategories = False
End With
ActiveChart.Axes(xlCategory).Select
With Selection.Border
.Weight = xlHairline
.LineStyle = xlAutomatic
End With
With Selection
.MajorTickMark = xlNone
.MinorTickMark = xlNone
.TickLabelPosition = xlNextToAxis
End With
With Selection.TickLabels
.Alignment = xlCenter
.Offset = 100
.ReadingOrder = xlContext
.Orientation = xlHorizontal
End With
ActiveChart.ChartArea.Select
ActiveChart.PlotArea.Select
With Selection.Border
.ColorIndex = 16
.Weight = xlThin
.LineStyle = xlContinuous
End With
Selection.Interior.ColorIndex = xlNone
ActiveChart.ChartArea.Select
ActiveChart.HasTitle = False
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,979
Default Another Pivot Chart Autoformating Question

You can loop through the worksheets and embedded charts. This example
will modify the first chart on each worksheet:

'======================
Sub FormatPivotChart()
Dim ws As Worksheet
Dim ch As ChartObject

For Each ws In ThisWorkbook.Worksheets
If ws.ChartObjects.Count Then
With ws.ChartObjects(1).Chart.SeriesCollection(1)
With .Border
.Weight = xlThin
.LineStyle = xlAutomatic
End With
.Shadow = False
.InvertIfNegative = False
With .Interior
.ColorIndex = 9
.Pattern = xlSolid
End With
End With
With ws.ChartObjects(1).Chart.ChartGroups(1)
.Overlap = 100
.GapWidth = 30
.HasSeriesLines = False
.VaryByCategories = False
End With
With ws.ChartObjects(1).Chart.Axes(xlCategory)
With .Border
.Weight = xlHairline
.LineStyle = xlAutomatic
End With
.MajorTickMark = xlNone
.MinorTickMark = xlNone
.TickLabelPosition = xlNextToAxis
End With
With ws.ChartObjects(1).Chart.Axes(xlCategory).TickLabe ls
.Alignment = xlCenter
.Offset = 100
.ReadingOrder = xlContext
.Orientation = xlHorizontal
End With
With ws.ChartObjects(1).Chart.PlotArea.Border
.ColorIndex = 16
.Weight = xlThin
.LineStyle = xlContinuous
End With
ws.ChartObjects(1).Chart.PlotArea.Interior.ColorIn dex = xlNone
ws.ChartObjects(1).Chart.HasTitle = False
End If
Next ws

End Sub
'=========================

SoBe wrote:
I have read through the other posts; but I still need some additional help
since I do not have Macro or VBA experience.

I am looking for a easy solution to reset all the pivot charts to my
formatting as noted below (from a recorded Macro that didn't work) after a
data refresh. There are about 20 tabs in the workbook with a pivot table and
chart on each tab. A manual macro that works on all tabs or an auto run macro
that works after a refresh is what I'm looking for. Any suggestions?

Thanks in advance,

Sub FormatPivotChart()
' FormatPivotChart Macro
'
ActiveSheet.ChartObjects("Chart 3").Activate
ActiveChart.SeriesCollection(1).Select
With Selection.Border
.Weight = xlThin
.LineStyle = xlAutomatic
End With
Selection.Shadow = False
Selection.InvertIfNegative = False
With Selection.Interior
.ColorIndex = 9
.Pattern = xlSolid
End With
With ActiveChart.ChartGroups(1)
.Overlap = 100
.GapWidth = 30
.HasSeriesLines = False
.VaryByCategories = False
End With
ActiveChart.Axes(xlCategory).Select
With Selection.Border
.Weight = xlHairline
.LineStyle = xlAutomatic
End With
With Selection
.MajorTickMark = xlNone
.MinorTickMark = xlNone
.TickLabelPosition = xlNextToAxis
End With
With Selection.TickLabels
.Alignment = xlCenter
.Offset = 100
.ReadingOrder = xlContext
.Orientation = xlHorizontal
End With
ActiveChart.ChartArea.Select
ActiveChart.PlotArea.Select
With Selection.Border
.ColorIndex = 16
.Weight = xlThin
.LineStyle = xlContinuous
End With
Selection.Interior.ColorIndex = xlNone
ActiveChart.ChartArea.Select
ActiveChart.HasTitle = False
End Sub



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html

  #3   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 3
Default Another Pivot Chart Autoformating Question

Wow! Great Debra thanks so much.

"Debra Dalgleish" wrote:

You can loop through the worksheets and embedded charts. This example
will modify the first chart on each worksheet:

'======================
Sub FormatPivotChart()
Dim ws As Worksheet
Dim ch As ChartObject

For Each ws In ThisWorkbook.Worksheets
If ws.ChartObjects.Count Then
With ws.ChartObjects(1).Chart.SeriesCollection(1)
With .Border
.Weight = xlThin
.LineStyle = xlAutomatic
End With
.Shadow = False
.InvertIfNegative = False
With .Interior
.ColorIndex = 9
.Pattern = xlSolid
End With
End With
With ws.ChartObjects(1).Chart.ChartGroups(1)
.Overlap = 100
.GapWidth = 30
.HasSeriesLines = False
.VaryByCategories = False
End With
With ws.ChartObjects(1).Chart.Axes(xlCategory)
With .Border
.Weight = xlHairline
.LineStyle = xlAutomatic
End With
.MajorTickMark = xlNone
.MinorTickMark = xlNone
.TickLabelPosition = xlNextToAxis
End With
With ws.ChartObjects(1).Chart.Axes(xlCategory).TickLabe ls
.Alignment = xlCenter
.Offset = 100
.ReadingOrder = xlContext
.Orientation = xlHorizontal
End With
With ws.ChartObjects(1).Chart.PlotArea.Border
.ColorIndex = 16
.Weight = xlThin
.LineStyle = xlContinuous
End With
ws.ChartObjects(1).Chart.PlotArea.Interior.ColorIn dex = xlNone
ws.ChartObjects(1).Chart.HasTitle = False
End If
Next ws

End Sub
'=========================

SoBe wrote:
I have read through the other posts; but I still need some additional help
since I do not have Macro or VBA experience.

I am looking for a easy solution to reset all the pivot charts to my
formatting as noted below (from a recorded Macro that didn't work) after a
data refresh. There are about 20 tabs in the workbook with a pivot table and
chart on each tab. A manual macro that works on all tabs or an auto run macro
that works after a refresh is what I'm looking for. Any suggestions?

Thanks in advance,

Sub FormatPivotChart()
' FormatPivotChart Macro
'
ActiveSheet.ChartObjects("Chart 3").Activate
ActiveChart.SeriesCollection(1).Select
With Selection.Border
.Weight = xlThin
.LineStyle = xlAutomatic
End With
Selection.Shadow = False
Selection.InvertIfNegative = False
With Selection.Interior
.ColorIndex = 9
.Pattern = xlSolid
End With
With ActiveChart.ChartGroups(1)
.Overlap = 100
.GapWidth = 30
.HasSeriesLines = False
.VaryByCategories = False
End With
ActiveChart.Axes(xlCategory).Select
With Selection.Border
.Weight = xlHairline
.LineStyle = xlAutomatic
End With
With Selection
.MajorTickMark = xlNone
.MinorTickMark = xlNone
.TickLabelPosition = xlNextToAxis
End With
With Selection.TickLabels
.Alignment = xlCenter
.Offset = 100
.ReadingOrder = xlContext
.Orientation = xlHorizontal
End With
ActiveChart.ChartArea.Select
ActiveChart.PlotArea.Select
With Selection.Border
.ColorIndex = 16
.Weight = xlThin
.LineStyle = xlContinuous
End With
Selection.Interior.ColorIndex = xlNone
ActiveChart.ChartArea.Select
ActiveChart.HasTitle = False
End Sub



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html


Reply
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
Autoformating Diefett Excel Discussion (Misc queries) 2 April 8th 07 02:58 PM
Form / Pivot Chart Question DavidHawes Excel Discussion (Misc queries) 1 March 1st 07 09:56 PM
Pivot Table Chart Question John Calder Charts and Charting in Excel 1 November 26th 06 06:56 PM
Pivot chart question Sunryzz Excel Discussion (Misc queries) 1 July 10th 06 07:43 PM
Pivot Chart Question Renee Charts and Charting in Excel 1 December 2nd 05 05:44 PM


All times are GMT +1. The time now is 07:13 PM.

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"