Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default trending data from a csv file with one macro with changing worksheet name.

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I display trending data in different colors (up=red) rmckay Excel Discussion (Misc queries) 1 November 5th 09 09:59 PM
changing a macro each time the file name changes andrewc Excel Discussion (Misc queries) 4 January 5th 09 09:04 PM
Trending data asim Excel Discussion (Misc queries) 0 July 6th 06 10:13 PM
Unable to run excel macro after changing file name merf New Users to Excel 2 June 14th 05 03:16 PM
Open delimited text file to excel without changing data in that file zohanc Excel Programming 1 October 3rd 03 01:06 AM


All times are GMT +1. The time now is 10:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"