JoeMajestee
New Member
- Joined
- Jul 15, 2009
- Messages
- 49
I am trying to create text files containing output like this:
Line-One
Line-Two\foo
My code generates the following output, with double-quotes. Make it stop!
"Line-One
Line-Two\foo"
Line-One
Line-Two\foo
My code generates the following output, with double-quotes. Make it stop!
"Line-One
Line-Two\foo"
VBA Code:
Sub CreateTextFiles()
Dim myfile As String, saveloc As String, mycell As Range, myrng As Range, mytext As String
mytext = "Line-One" & vbCrLf & _
"Line-Two\"
Set myrng = Selection
saveloc = "c:\test\"
For Each mycell In myrng
myfile = saveloc & mycell & ".txt"
Open myfile For Output As #1
Write #1, mytext & mycell
Close #1
Next mycell
MsgBox "Finished", vbOK, "TXT Creation tool"
End Sub