djburnheim
Technical User
When I open a CSV file using the code below the dates in the CSV which are in the format dd/mm/yyyy change to mm/dd/yyyy. If I open the CSV file through explorer it's all fine. Any ideads why this would happen???
***code***
Summary = "J:\Tsdshared\CallCentre\Weekly stats\Summary*.csv"
Queue = "J:\Tsdshared\CallCentre\Weekly stats\Queue*.csv"
Workbooks.OpenText FileName:=Queue, DataType:=xlDelimited, Comma:=True
Sheets(1).Select
Sheets(1).Move After:=Workbooks("Daily Stats.xls".Sheets(1)
Workbooks.OpenText FileName:=Summary, DataType:=xlDelimited, Comma:=True
Sheets(1).Select
Sheets(1).Move After:=Workbooks("Daily Stats.xls".Sheets(2)
'Match date in report sheet with column in Daily Stats
ReportDate = Format(Sheets(1).Cells(5, 2), "dd-MMM"
With Workbooks("Daily Stats.xls".Sheets(1).Range("a1:Q40"
Set dCell = .Find(ReportDate)
If Not dCell Is Nothing Then
dColumn = dCell.Column
dRow = dCell.Row
End If
End With
***code***
Summary = "J:\Tsdshared\CallCentre\Weekly stats\Summary*.csv"
Queue = "J:\Tsdshared\CallCentre\Weekly stats\Queue*.csv"
Workbooks.OpenText FileName:=Queue, DataType:=xlDelimited, Comma:=True
Sheets(1).Select
Sheets(1).Move After:=Workbooks("Daily Stats.xls".Sheets(1)
Workbooks.OpenText FileName:=Summary, DataType:=xlDelimited, Comma:=True
Sheets(1).Select
Sheets(1).Move After:=Workbooks("Daily Stats.xls".Sheets(2)
'Match date in report sheet with column in Daily Stats
ReportDate = Format(Sheets(1).Cells(5, 2), "dd-MMM"
With Workbooks("Daily Stats.xls".Sheets(1).Range("a1:Q40"
Set dCell = .Find(ReportDate)
If Not dCell Is Nothing Then
dColumn = dCell.Column
dRow = dCell.Row
End If
End With