Hello,
I have got a Excel Spreadsheet which upon opening runs a macro which opens all .tsv files in a folder and creates them as Worksheets in Excel with the same name as the file. The name of the sheets are based on Dates and will be changing regularly, once it's over 8 weeks old it will be deleted.
However I need to create a chart across the different sheets, automatically without having to worry about sheet names.
Is there a way to do this?
What I have so far:
This works but when this data is deleted, it can't be used anymore and the new data will be missed.
ActiveChart.FullSeriesCollection(1).Values = "='20171013-LTPC01'!$C$3:$C$9"
I have tried creating a Function called SHEETNAME
Function SHEETNAME(b As Long) As String
SHEETNAME = Sheets(b).Name
End Function
ActiveChart.FullSeriesCollection(1).Values = "=SHEETNAME(1) '!$C$3:$C$9"
This causes an application or object defined error.
Has anyone got any ideas on how to solve this?
Thanks
I have got a Excel Spreadsheet which upon opening runs a macro which opens all .tsv files in a folder and creates them as Worksheets in Excel with the same name as the file. The name of the sheets are based on Dates and will be changing regularly, once it's over 8 weeks old it will be deleted.
However I need to create a chart across the different sheets, automatically without having to worry about sheet names.
Is there a way to do this?
What I have so far:
This works but when this data is deleted, it can't be used anymore and the new data will be missed.
ActiveChart.FullSeriesCollection(1).Values = "='20171013-LTPC01'!$C$3:$C$9"
I have tried creating a Function called SHEETNAME
Function SHEETNAME(b As Long) As String
SHEETNAME = Sheets(b).Name
End Function
ActiveChart.FullSeriesCollection(1).Values = "=SHEETNAME(1) '!$C$3:$C$9"
This causes an application or object defined error.
Has anyone got any ideas on how to solve this?
Thanks