Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The easiest way is to turn on the macro recorder and than go through the
steps. After you turn the recorder off, go to the VB Editor and edit the code for future use. hth -- steveB (Remove 'NOSPAM' from email address if contacting me direct) "RK" wrote in message m... Hi, I am a student and have done introductory programming in C, C++ and C#. But I have never worked with Files and I/O. I have around 100 of .dat files containing data seperated by commas. Each row has 4 values seperated by comma. New row starts at new line. I want to open that .dat file in Excel, arrange the values seperated by commas in seperate columns and plot a X-Y graph for two columns on that. I know how to do it manually for each file. But since there are 100 such files, its very time-consuming to do it for all. So I want to write a program which will do all the steps. Can you please help me in writing a program for this in any of the above mentioned languates? The steps which I follow for EACH file manually are as given below: ---------------------------------------------- File is saved as "test.dat". There are four values in each row, each is separated by comma. New row starts at new line. 1. Open "test.dat" with Microsoft Office Excel. All the records are in column A. 2. Select Column A. 3. Go to "Data -- Texts To Columns . (Gives Convert Text to Columns Wizard)." 4. Select "Delimited" as Original data Type. Click Next. 5. Select "Comma" as Delimiters. Click Next. 6. Select "General" as Column Data Format. Click Finish. 7. This gives all 4 columns separately in columns A, B, C and D. 8. Select columns B and C. 9. Click on Chart Wizard. 10. In the 'Chart Type' window, select "Custom Types". 11. Select "User-defined" as Select From. 12. It will show two chart-types. One is default and another is "Testing", which I created. 13. Select "Testing". Click Next. 14. Click Next on "Chart Source Data", as the data range is already selected from columns B and C. 15. Give Title to Chart as the file name, i.e. Test. 16. Click Next. 17. Select "As Object In" <File Name as Chart Location. 18. Click Finish. 19. Save the file as test.xls, in the same directory. At the end there are two files in that directory. test.dat and test.xls. ----------------------------------------------- Any help in writing program for this is greatly appreciated. Thanks and Regard, RK |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Simulation in operations research using Excel | Excel Worksheet Functions | |||
Excel Iterations? Conditional Operations? | Excel Discussion (Misc queries) | |||
Excel Iterations? Conditional Operations? | Excel Worksheet Functions | |||
OWC operations in Excel | Excel Discussion (Misc queries) | |||
excel vba array basic operations | Excel Programming |