Hi - I have a workbook with a number of sheets, each which have a single chart, which the organization I work for use to create a standardized report for clients. Each client provides us with a different data set (from a survey), and thus the chart ranges / origin need to change with each new data set.
All charts across the different sheets use the same Range / Origin from the dataset.
I found this Macro in a previous forum which seems to work for one chart, and one sheet. Any way to tweak this so that it works for all charts (or perhaps just more than 1 chart), all sheets?
Private Sub SetAxisScales()
With ActiveSheet.ChartObjects("Chart 1").Chart
With .Axes(xlValue)
.MaximumScale = ActiveSheet.Range("Ymax").Value
.MinimumScale = ActiveSheet.Range("Ymin").Value
.MajorUnit = ActiveSheet.Range("Ymajor").Value
.MinorUnit = ActiveSheet.Range("Yminor").Value
End With
End With
End Sub
Bookmarks