Open .CSV with formatting

J

John Sutton

Is is possible to open a .CSV file with formatting options in place.

I like to open

"Bob Jones",12345,"4567 Somestreet","Anytown","TX","99999-9999",

where the second column would be custom formatted with 000000000000,
where the 12345 would show as 000000012345.

Thanks
John
 
D

Dave Peterson

CSV files are just plain text. The best you could do is run a macro after you
imported the file.
 
P

Pete_UK

Presumably this is something you would want to do many times, so why
not open the file then turn the macro recorder on and select column B
and format it as required (and possibly column F) then turn the
recorder off. In future you can just run the macro again to get the
formatting as you would like it.

Hope this helps.

Pete
 
J

John Sutton

Thanks to both for replying so quickly.
I am a developer, and for reasons beyond my control, I have to create
a .CSV file, then spawn an instance of excel with the .CSV open. I had
come to the same conclusion as both of you, but wanted to see if there
were options other than my limited experience.

I think that my solution will be to have a spreadsheet that is already
formatted, open it as well as the .CSV, and copy/paste thru a recorded
macro.

I know how to open, copy/paste and close the .csv file within a macro,
is there a way to do this in some kind of 'OPEN' macro, so that it
will be executed when I open the formatted spreadsheet.

Thanks
John
 
D

Dave Peterson

If you name your procedure Auto_Open, then it'll run when ever you open that
workbook.
 
D

Dave Peterson

Remember to backup.

It's especially important for something that works! <vbg>
 
Top