Created
January 23, 2013 16:58
-
-
Save RichPollock/4609894 to your computer and use it in GitHub Desktop.
Change the data range of an Excel chart without using .Activate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
With Sheets("Source Data Sheet Name") | |
Set ChartXRange = .Range("A1:A10") | |
Set ChartRange = .Range("B1:B10") | |
End With | |
Sheets("Chart Sheet Name").ChartObjects("Chart Name").Chart.SeriesCollection(1).XValues = ChartXRange | |
Sheets("Chart Sheet Name").ChartObjects("Chart Name").Chart.SeriesCollection(1).Values = ChartRange |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment