' this seems to work in excel 97 which is what I have at home
' it formats all charts on all sheets on open workbooks
' I used your formating code so i assume this is the desired format
' You could put the entries for formats, scales, etc in cells on a worksheet
' and then refer to them
Sub macro1()
Dim mywkbk As Workbook
Dim mywksht As Worksheet
Dim mycht As ChartObject
On Error Resume Next
For Each mywkbk In Application.Workbooks
mywkbk.Activate
For Each mywksht In ActiveWorkbook.Worksheets
mywksht.Activate
'
' This is a counter to see if the sheet got selected
'
Cells(1, 1).Value = Cells(1, 1).Value + 1
'
For Each mycht In ActiveSheet.ChartObjects
mycht.Activate
mycht.Chart.ChartTitle.Select
Selection.AutoScaleFont = True
With Selection.Font
.Name = "Tahoma"
.FontStyle = "Bold"
.Size = 12
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
ActiveChart.Axes(xlValue).Select
Selection.TickLabels.AutoScaleFont = True
With Selection.TickLabels.Font
.Name = "Tahoma"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
ActiveChart.Axes(xlCategory).Select
Selection.TickLabels.AutoScaleFont = True
With Selection.TickLabels.Font
.Name = "Tahoma"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
ActiveChart.SeriesCollection(1).DataLabels.Select
Selection.AutoScaleFont = True
With Selection.Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
ActiveChart.Axes(xlValue).AxisTitle.Select
Selection.AutoScaleFont = True
With Selection.Font
.Name = "Tahoma"
.FontStyle = "Bold"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
Next mycht
Next mywksht
Next mywkbk
End Sub
Bookmarks