OriginalNick2
07-30-2008, 05:12 AM
Hiya,
I've got a problem with some data in Excel.
I use a spreadsheet to capture multiple reports and sort the data, the reports are gathered by copying the worksheet in to my workbook.
This all works fine but the data in one report refuses to be formatted as [hh]:mm:ss or anything other than text for that matter.
Apparently there is a hidden character that denotes the format of the cell ( ' being for text)
So i have all these times that are formatted as text, the only way to change them is to physically click into the cell, as if one was to edit the contents, and return out of it, the format that correctly displays as time.
It has been suggested that copying the data into notepad and back again solves this problem.
Unless anyone knows how to correct the source problem, i'm now stuck with this code
'Database logging
Dim fso, a, logFile, WSHNetwork
'change following log path and file name as needed
logFile = Left(ActiveWorkbook.FullName, (Len(ActiveWorkbook.FullName) - 8)) & "\holder.txt"
Set fso = CreateObject("Scripting.FileSystemObject")
Const OPEN_FILE_FOR_APPENDING = 8
Set a = fso.OpenTextFile(logFile, OPEN_FILE_FOR_APPENDING)
'write data
a.writeline
'close file
a.Close
Set fso = Nothing
at a.writeline i need paste, or the sendkey "^V" to work but cant get this to happen, further on i would also need select all, copy too.
Any ideas?
Many Thanks,
Nick
I've got a problem with some data in Excel.
I use a spreadsheet to capture multiple reports and sort the data, the reports are gathered by copying the worksheet in to my workbook.
This all works fine but the data in one report refuses to be formatted as [hh]:mm:ss or anything other than text for that matter.
Apparently there is a hidden character that denotes the format of the cell ( ' being for text)
So i have all these times that are formatted as text, the only way to change them is to physically click into the cell, as if one was to edit the contents, and return out of it, the format that correctly displays as time.
It has been suggested that copying the data into notepad and back again solves this problem.
Unless anyone knows how to correct the source problem, i'm now stuck with this code
'Database logging
Dim fso, a, logFile, WSHNetwork
'change following log path and file name as needed
logFile = Left(ActiveWorkbook.FullName, (Len(ActiveWorkbook.FullName) - 8)) & "\holder.txt"
Set fso = CreateObject("Scripting.FileSystemObject")
Const OPEN_FILE_FOR_APPENDING = 8
Set a = fso.OpenTextFile(logFile, OPEN_FILE_FOR_APPENDING)
'write data
a.writeline
'close file
a.Close
Set fso = Nothing
at a.writeline i need paste, or the sendkey "^V" to work but cant get this to happen, further on i would also need select all, copy too.
Any ideas?
Many Thanks,
Nick