ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   csv to xls - data format (https://www.excelbanter.com/excel-programming/350740-csv-xls-data-format.html)

SR

csv to xls - data format
 
Hi

I have .csv files to be opened in xls format make few corrections on the
data or number fields and save it back as .csv file.

problems:
1.when I open the .csv file as .xls, the date and numeric fields do not
match the data of .csv file. I assume it has been converted to the default
settings of the excel sheet.
2. after corrections are made, I want to save the file back to .csv file

I have never written a macro. So can one of you help.

Shanti

Dave Peterson

csv to xls - data format
 
Rename the .csv file to .txt
start a new workbook
record a macro when you open the file--specify the correct date format for each
date field.
keep recording when you're updating the file--if your updates are all the same
save the workbook as a .csv file
stop recording

When you want to convert another file, just rerun that macro (remembering to
rename the .csv file to .txt before you start).

SR wrote:

Hi

I have .csv files to be opened in xls format make few corrections on the
data or number fields and save it back as .csv file.

problems:
1.when I open the .csv file as .xls, the date and numeric fields do not
match the data of .csv file. I assume it has been converted to the default
settings of the excel sheet.
2. after corrections are made, I want to save the file back to .csv file

I have never written a macro. So can one of you help.

Shanti


--

Dave Peterson


All times are GMT +1. The time now is 11:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com