Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Write to csv
Hi,
I am writing to a csv. Here is the issue, I am writing data that is text, number, and dates. I can write the values to csv using the string data type but there are quotes around all of the data. Is it possible to get rid of the quotes. "....." Option Explicit Sub MainTest() Dim tFilename As String Dim tFilelocation As String tFilename = "Iinforce.csv" tFilelocation = "C:\" Call FixIinforce(tFilename, tFilelocation) End Sub Sub FixIinforce(Filename As String, FileLocation As String) Dim Sourcefile As String Dim Outputfile As String Dim i As Integer Dim k As Integer Dim temp As String Sourcefile = FileLocation & Filename Outputfile = FileLocation & "Iinforce(new).csv" Open Sourcefile For Input As #1 '#SourceFileNb Open Outputfile For Output As #2 '#OutputFileNb 'Key Past Header For i = 1 To 42 Input #1, temp Write #2, temp, Next i Input #1, temp Write #2, temp For k = 1 To 1000 For i = 1 To 43 Select Case i Case 1 To 2 Input #1, temp Write #2, k, Case 3 To 42 Input #1, temp Write #2, temp, Case 43 Input #1, temp Write #2, temp End Select Next i Next k Close #1 Close #2 MsgBox "Done!" End Sub Thanks for your help |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I write X^2? | New Users to Excel | |||
Write to a New Spreadsheet | Excel Discussion (Misc queries) | |||
How do you write a T with a bar on it? | Excel Discussion (Misc queries) | |||
is it possible to execute write to the fields in another .xsl form a macro in another .xsl? e.g. some way to load another .xsl into an .xsl macro and write to its data? | Excel Worksheet Functions | |||
How to I write a UDF? | Excel Discussion (Misc queries) |