Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I currently have multiple csv files from a SCADA computer system that I am converting to excel spreadsheets. All of these files have a designated name like "TANKS000.csv". If the files are not converted within a 24 period then The SCADA Program will create another CSV file named "TANKS001.csv". Here is my problem, how can I write the macro to trend my data to a chart no matter what the worksheet is named? Here is a sample of the macro where I am getting hung up.
ActiveChart.SetSourceData Source:=Sheet("TANKS000").Range("B8:M103"), _ PlotBy:=xlColumns I need help!!!! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you only have one sheet that contains the name TANKS
for each sh in thisworkbook.Worksheets if instr(1,sh.name,"tanks",vbTextCompare) then set sh1 = sh exit for end if Next ActiveChart.SetSourceData Source:=sh1.Range("B8:M103"), _ PlotBy:=xlColumns or based on your later post for each sh in thisworkbook.Worksheets if instr(1,sh.name,"tanks",vbTextCompare) then sh.name = "Tanks" exit for end if Next ActiveChart.SetSourceData Source:=Sheet("TANKS").Range("B8:M103"), _ PlotBy:=xlColumns -- Regards, Tom Ogilvy Ray Morton wrote in message ... I currently have multiple csv files from a SCADA computer system that I am converting to excel spreadsheets. All of these files have a designated name like "TANKS000.csv". If the files are not converted within a 24 period then The SCADA Program will create another CSV file named "TANKS001.csv". Here is my problem, how can I write the macro to trend my data to a chart no matter what the worksheet is named? Here is a sample of the macro where I am getting hung up. ActiveChart.SetSourceData Source:=Sheet("TANKS000").Range("B8:M103"), _ PlotBy:=xlColumns I need help!!!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I display trending data in different colors (up=red) | Excel Discussion (Misc queries) | |||
changing a macro each time the file name changes | Excel Discussion (Misc queries) | |||
Trending data | Excel Discussion (Misc queries) | |||
Unable to run excel macro after changing file name | New Users to Excel | |||
Open delimited text file to excel without changing data in that file | Excel Programming |