I have the following code that formats a couple of charts based on data that is received every minute. The problem is that it makes the sheet where the formatting is occuring the active/visible sheet. This workbook contains multiple worksheets and I don't want it to switch to "process" every time it formats the charts. I would like this to happen in the background. Any help is appreciated.
Code:
Sheets("Process").ChartObjects("chart 8").Activate
ActiveChart.PlotArea.Select
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
.MinimumScale = (Range("h19") - 2)
.MaximumScale = (Range("d19") + 2)
.MinorUnit = 1
.MajorUnit = 1
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlinear
End With
Sheets("Process").ChartObjects("chart 9").Activate
ActiveChart.PlotArea.Select
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
.MinimumScale = (Range("h31") - 2)
.MaximumScale = (Range("d30") + 2)
.MinorUnit = 1
.MajorUnit = 1
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlinear
End With
End If
End Sub