This code I am using writes cell data to a text file starting from A1 and going down the column. Each line/row is written in quotes. How can I disable or replace the quotes with blanks in the text file?
Here is the code:
Sub Generate()
'
' Generate Macro
'
' Keyboard Shortcut: Ctrl+t
'
Dim flag As Boolean
Dim i As Integer
'open the file for writing
Open "C:\Temp\Test.txt" For Output As #1
flag = True
i = 1
'keeps going until the end of the file is reacheed
While flag = True
'check if the current cell has data in it
If Cells(i, 1) <> "" Then
'write the data to the file
Write #1, Cells(i, 1)
'go to next cell
i = i + 1
Else
'if the last row has been reached exit the loop
flag = False
End If
Wend
'close the file
Close #1
End Sub
Bookmarks