Maybe this :
Application.Calculation = xlCalculationAutomatic
qurl = ThisWorkbook.Path & "\" & ticker & ".txt"
On Error Resume Next
Kill qurl
On Error GoTo 0
DataSheet.Copy
With ActiveSheet
.Rows("1:6").Delete xlShiftUp
With .Range("A1").CurrentRegion.Resize(, 8).Offset(, 8)
.Formula = Array(ticker, "=TEXT(G1,""YYYYMMDD"")", "=TEXT(G1,""HH:MM:"")&""00""", "=E1", "=C1", "=D1", "=B1", "=F1")
.Rows(1).Value = Array("Symbol", "Date", "Time", "OPEN", "HIGH", "LOW", "CLOSE", "VOLUME")
.Rows(.Rows.Count).ClearContents
.Value = .Value
End With
.Columns("A:H").Delete xlShiftToLeft
.Columns("C").NumberFormat = "HH:MM:SS"
.SaveAs Filename:=qurl, FileFormat:=xlCSV
End With
Application.DisplayAlerts = False
ActiveWorkbook.Close
Application.DisplayAlerts = True
End Sub
Bookmarks