Question Locked

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

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,

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

3 replies

by thumbsup2

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:\\", 0, True

where , of course, points to where the file is stored and 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.

by horppana

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.

This discussion is closed to new replies.