I tried recording a macro that generates a scatter plot using one column as the x-axis data, and several columns for y. The plots come out correctly when I record the macro, but when I apply it to new data, it plots it by index, rather than data points. For example:
Correct:
x...................y
1.4928............1394.23
2.3459............2492.42
3.9846............142.42
Macro:
x.................y1.................y2
1..............1.4928...........1394.23
2..............2.3459...........2492.42
3..............3.9846............142.42
How can I specify the x-axis for the macro, when I already tried to do it during the recording? I found I can do it by hand, but it is tedious; I have to select each series at a time and re-select the x-axis data, making a macro obsolete. Here is my code for one of the plots, and I have attached the graphs.
![]()
Please Login or Register to view this content.
The workbook originally has a ton of data, but is reduced significantly when the macro is run. I've also attached what the graph looked like when I recorded the macro, and what it should look like. Thank you.
Bookmarks