I have written a macro to dump excel cells on to a notepad file. The cell contents appear along with a ” in the .txt file. How do I get rid of the double quotes before writing it to the file?
Sub makeFile1()
Dim ce As Range
Dim ws As Worksheet
Open "C:\queries.txt" For Output As #1
For Each ws In ActiveWorkbook.Worksheets
Write #1, "Create Table " & ws.Name
For Each ce In Range("G2:G10")
If ce.Next = "" Then
Write #1, ce.Value
ElseIf ce.Value <> "" Then
Write #1, ce.Value & ","
End If
Next ce
Next ws
Close #1
End Sub
Use
Print #1instead ofWrite #1