If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Automating charts from a csv file
Hello,
ons of our softwares creates some csv file everyday. Is there a way to create charts automatically via excel from this csv file? Thank you Erman Ulusoy |
#2
|
|||
|
|||
Automating charts from a csv file
Erman -
Sure, this is actually fairly easy to do. Start by recording a macro: Sub Macro2() ' ' Macro2 Macro ' Macro recorded 2/27/2004 by Jon Peltier ' ' Workbooks.Open FileName:= _ "\\holy\cow\where\is\that\file\Y03\M04\03040109CW. csv" Charts.Add ActiveChart.ChartType = xlXYScatterLinesNoMarkers ActiveChart.SetSourceData _ Source:=Sheets("03040109CW").Range("A22:E48") ActiveChart.Location Whe=xlLocationAsObject, Name:="03040109CW" End Sub Now add features like a GetOpenFileName dialog to allow the user to select the file, or something that gets a file which has today's date embedded in its filename. And something that detects whether the source data range is larger or smaller than normal. And special formatting that your chart may need. I do this all the time, and my coworkers are always amazed. I guess I've never let on how easy it is. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services http://PeltierTech.com/Excel/Charts/ _______ erman wrote: Hello, ons of our softwares creates some csv file everyday. Is there a way to create charts automatically via excel from this csv file? Thank you Erman Ulusoy |
Thread Tools | |
Display Modes | |
|
|