How can i make the code for an excel macro be universal and not only work for one file?
So i am writing a macro to graph a large set of data. After finishing writing the macro it worked fine on its original fie in this case 234
here is one of the original sets of key data.
ActiveChart.SeriesCollection(1).XValues = "='234'!$A$27:$A$1490"
It specifies the 234 as the file to retrieve the data.
I assumed that after replacing the 234 in the line of code above with a command like sheetname. like so below.
ActiveChart.SeriesCollection(1).XValues = "='sheetname'!$A$27:$A$1490"
Who ever can successfully answer will receive a patch. Feel free to ask questions because what i wrote above is a slight bit vauge.