I need to incorporate a process to remove the extra quotation marks generated by excel when exporting to a text document. I have several lines of text that include quotation marks intentionally, I want to keep these quotation marks unfortunately excel likes to add extras. The existing code to do the export is:
Dim wks As Worksheet
Dim path As String
Application.ScreenUpdating = False
path = "H:\Flags\"
Set wks = Worksheets("Compiled")
ActiveWorkbook.SaveAs path & ThisWorkbook.Sheets("Entry").Range("C2").Value & ".EB", xlTextWindows
Application.ScreenUpdating = True
I was fortunate enough to be helped along with this bit by rorya.
The other code I've found to remove extra quotations is:
Dim r As Range, c As Range
Dim sTemp As String
Open "c:\MyOutput.txt" For Output As #1
For Each r In Selection.Rows
sTemp = ""
For Each c In r.Cells
sTemp = sTemp & c.Text & Chr(9)
'Get rid of trailing tabs
While Right(sTemp, 1) = Chr(9)
sTemp = Left(sTemp, Len(sTemp) - 1)
Print #1, sTemp
I don't really understand how to incorporate this with my existing information, and am not sure if it would work.
Ideally, the end result will be a combined macro to allow me to export based on the first script and keep the original formatting by removing extra quotes, and without requiring any additional data entry.