Macro to look values from .csv and place them in Excel-spreadsheet?

By Horppana ·

I'm a newbie what comes to programming, but now I need to get a
thing done. I need a macro for Excel, to get data from server
generated .csv and place those in some particular cells in a ready
customized spreadsheet. How this can be done?

I'm not even sure how I write such a thing on mac that would also
work on windows...

Please, help O_o

- Horppana

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
Thread display: Collapse - | Expand +

All Answers

Collapse -

re: CSV to Excel Macro

by ThumbsUp2 In reply to Macro to look values from ...

Since CSV files can be opened in Excel, all you have to do is write the macro to open the CSV file, then traverse the CSV file the same as you would any other spreadsheet.

The VB command (in your macro) to open the CSV file is:

Workbooks.Open "C<path to the file>\<filename.csv>", 0, True

where <path to file>, of course, points to where the file is stored and <filename.csv> points to the file itself (without the brackets and all case sensitive). C: of corse is the drive the file is stored on.

Once that file is opened, in the script you simply copy the contents of a particular cell to a variable, then put the contents of the variable into a pre-determined cell in the Excel spreadsheet.

The part I'm NOT sure about is compatibility between MAC and Windows and I have no way to test. Try a simple script written on the MAC, copy it to a Windows machine and see if that will work before you go to all the trouble of writing the big one.

Of course, if you don't know how to write macros, you'll need to learn VB before you can do anything else. You may need the services of a PRO.

Collapse -

re: CSV to Excel Macro

by Horppana In reply to re: CSV to Excel Macro

Ok, that seems to be a straight forward method, I'll try that
as the first thing tomorrow :)

Thank you, that was a quick one.

Back to Networks Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums