#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 921
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I write X^2? webb New Users to Excel 2 October 15th 07 08:21 AM
Write to a New Spreadsheet Daniell Excel Discussion (Misc queries) 3 October 5th 05 10:21 PM
How do you write a T with a bar on it? sheezyspearean Excel Discussion (Misc queries) 1 September 15th 05 03:43 PM
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? Daniel Excel Worksheet Functions 1 June 23rd 05 11:38 PM
How to I write a UDF? Dr. Juzzy Excel Discussion (Misc queries) 1 January 30th 05 02:17 PM


All times are GMT +1. The time now is 04:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"