I have a number of system-generated csv files which among other data, contains a list of dates. Manually copying and pasting the content of these works as expected, but using the below code results in the dates as US date format.
I've tried reformatting them within the code, or using text-to-columns but nothing seems to work. What am I doing wrong???
I've tried reformatting them within the code, or using text-to-columns but nothing seems to work. What am I doing wrong???
Code:
Sub Update()
Dim i As Integer
Dim sh As String
Dim Path As String
Dim This_File As String
With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
End With
Path = ThisWorkbook.Path
This_File = ThisWorkbook.Name
For i = 1 To 4
sh = WorksheetFunction.Choose(i, "Onshore", "Offshore", "PL", "PL Offshore")
Workbooks.Open Path & "\" & sh & ".csv"
With Workbooks(sh & ".csv")
.Sheets(sh).Cells.Copy Workbooks(This_File).Sheets(sh).Cells(1, 1)
.Close False
End With
Next i
Application .ScreenUpdating = True
End Sub