CSV Date Format
I have a VB application which extracts data and creates 3 CSV files (a.csv, b.csv, c.csv). Then I use another Excel spreadsheet (import.xls) to import all the data from the above CSV files into this sheet.
import.xls file has a macro which opens the CSV files one by one and copies the data. The problem I am facing is the dates in the CSV files are stored as mm/dd/yyyy and this is copied as is to the Excel sheet. But I want the date in dd/mm/yyy format.
When I open any of the CSV files manually the dates are displayed in the correct format (mm/dd/yyyy). Any idea how I can solve this issue?
Answer
You can use the Format VBA function:
Format(DateText, "dd/mm/yyyy")
That will format it how ever you like.
For a more permanant solution, try changing your regional settings in windows itself, Excel uses this for its date formatting.
Start -> Settings -> Control Panel -> Regional Options.
Make sure that the language is set to whatever is appropriate and that the date settings are as you want them to be
Related Questions
- → Trait 'IlluminateFoundationBusDispatchesJobs' not found
- → Laravel save CSV file error
- → Importing large CSV files in MySQL using Laravel
- → VBA how do I edit cell contents based on contents of two other cells in same row
- → How to work with PHPWord and LaravelExcel in Laravel 5.1 framework?
- → How to generate heading for columns?
- → VBA Excel run javascript form event
- → Reading excel file in Laravel
- → Remove Links on Excel after rendered from table2excel.js
- → Create JSON with through Excel Hierarchy
- → How to download fetch response in react as file
- → Laravel Excel big export. Server error 500
- → Download XLSX file on anchor link click in Laravel 5.2