Hi all,
I inherited this code which changes the start and end dates on the X axis for a graph. I can't figure out how to change the series ranges to match.
As always, any help would be appreciated.
Cheers,
Henio
For Each MyChart In ActiveSheet.ChartObjects
MyChart.Select 'select chart
On Error Resume Next
'actually change date
With ActiveChart.Axes(xlCategory)
.MinimumScale = StartDate 'start date
.MaximumScale = EndDate 'end date
.BaseUnitIsAuto = True
.MajorUnit = 1
.MajorUnitScale = xlDays
.MinorUnitIsAuto = True
.Crosses = xlAutomatic
.AxisBetweenCategories = True
.ReversePlotOrder = False
End With
'change direction of text
With ActiveChart.Axes(xlCategory).TickLabels
.Alignment = xlCenter
.Offset = 100
.Orientation = xlUpward
End With
I inherited this code which changes the start and end dates on the X axis for a graph. I can't figure out how to change the series ranges to match.
As always, any help would be appreciated.
Cheers,
Henio
For Each MyChart In ActiveSheet.ChartObjects
MyChart.Select 'select chart
On Error Resume Next
'actually change date
With ActiveChart.Axes(xlCategory)
.MinimumScale = StartDate 'start date
.MaximumScale = EndDate 'end date
.BaseUnitIsAuto = True
.MajorUnit = 1
.MajorUnitScale = xlDays
.MinorUnitIsAuto = True
.Crosses = xlAutomatic
.AxisBetweenCategories = True
.ReversePlotOrder = False
End With
'change direction of text
With ActiveChart.Axes(xlCategory).TickLabels
.Alignment = xlCenter
.Offset = 100
.Orientation = xlUpward
End With