Link to home
Start Free TrialLog in
Avatar of Tek Info
Tek Info

asked on

Importing CSV file into Excel or another program

I would like to import data from a CSV file into a pre-formatted Excel spreadsheet.
The CSV file has 25 fields.  The Excel sheet is made to look like a form.
The CSV file will change daily.
Is there a way to import the data using a script or macro directly into the Excel spreadsheet?

Excel does not have to be used, however even Word or another office program can be used. GeneralForm.xlsxCSV.csv
Avatar of Alex
Alex
Flag of United Kingdom of Great Britain and Northern Ireland image

You'd have to use a macro, but you need to provide the pre-formatted sheet as well as the headers of your CSV file so we can see what goes where.

regards
Alex
You can use the Get Data option to import the raw data from a CSV file. This will import it at as a list. Shouldn't need VBA as you can do a refresh to import new data, assuming the file name stays the same.

You could then maybe use formulas on a separate sheet to populate the data into the form layout you need.
Might also be worth looking at Word Mail Merge feature, this can pull directly into a form layout on the Word page.
Mail merge would work, that's actually not a bad shout at all.
Avatar of Tek Info
Tek Info

ASKER

Thanks Alex and Rob.
I have attached a sample CSV file and the resulting type Excel form.
Would a macro work here? Or perhaps a script?
ASKER CERTIFIED SOLUTION
Avatar of Rob Henson
Rob Henson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks very much Rob.
Thanks kindly for offering this type of solution.
The problem is that the CSV file will always have a different name and will reside on a server at a specified location.
The issue as well is that this needs to be very easy for a user to perhaps from a program or script, choose the file in question, then import the data into the "form".
Can this be automated to accommodate something like this?
Thanks in advance for any help.
Best,
Yes, I will finish up a couple of things and try to make a PS script for you.
The problem is that the CSV file will always have a different name and will reside on a server at a specified location
If your looking for an easy to use solution, then save the file under a invariant name. This is easy to do, when your "The CSV file will change daily." is an automated process.
Thanks ste5an, so how would you propose solving this?
In the case of an automated process, I would simply copy the newest file to the shared path using the fixed name.
I am not a programmer therefore any assistance would be appreciated.
hi Tek I'd gladly give you an answer let me hit home
@ Jose Gabriel Ortega Castro
Thanks very much, I look forward to your assistance, very much appreciated.
Thsnk you. Not exactly what I’m looking for but on the right track.  No one else was able to automate this for me in any way, not even using a script. Now I must close this.