wagdownunder
New Member
- Joined
- Nov 19, 2010
- Messages
- 8
Hi
I have downloaded this macro to export data from excel to a csv file. Everything works fine except when the date and time is exported. It seems that the date and time formats of excel is ignored are there a way of incoporating it in this macro?
any feedback would be appreciated
Daniel
Sub csvfile()
Dim fs As Object, a As Object, i As Integer, s As String, t As String, l As String, mn As String
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("c:\Quanta Data_" & Format(Now, "YYYYMMDD_HHMMSS") & ".csv", True)
For r = 26 To Range("A65536").End(xlUp).Row
s = ""
c = 1
While Not IsEmpty(Cells(r, c))
s = s & Cells(r, c) & ","
c = c + 1
Wend
a.writeline s 'write line
Next r
End Sub
I have downloaded this macro to export data from excel to a csv file. Everything works fine except when the date and time is exported. It seems that the date and time formats of excel is ignored are there a way of incoporating it in this macro?
any feedback would be appreciated
Daniel
Sub csvfile()
Dim fs As Object, a As Object, i As Integer, s As String, t As String, l As String, mn As String
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("c:\Quanta Data_" & Format(Now, "YYYYMMDD_HHMMSS") & ".csv", True)
For r = 26 To Range("A65536").End(xlUp).Row
s = ""
c = 1
While Not IsEmpty(Cells(r, c))
s = s & Cells(r, c) & ","
c = c + 1
Wend
a.writeline s 'write line
Next r
End Sub