South_Florida
New Member
- Joined
- Jun 1, 2016
- Messages
- 9
So I'm recording a macro to display an XY scatter plot graph. I have had to add a second data series to get the x-axis I need but when opening other .txt files this line of code fails as it has the name of the original .txt file used to create the macro. The problem line(s) of code are shown below.
ActiveChart.SeriesCollection(2).XValues = "='Pure Ethanol 12May16'!$O$1:$O$5"
ActiveChart.SeriesCollection(2).Values = "='Pure Ethanol 12May16'!$P$1:$P$5"
Just removing the 'Pure Ethanol 12May16'! line did not help as then it does not display my second series on the graph that I need. Any help would be greatly appreciated!
ActiveChart.SeriesCollection(2).XValues = "='Pure Ethanol 12May16'!$O$1:$O$5"
ActiveChart.SeriesCollection(2).Values = "='Pure Ethanol 12May16'!$P$1:$P$5"
Just removing the 'Pure Ethanol 12May16'! line did not help as then it does not display my second series on the graph that I need. Any help would be greatly appreciated!