I have a comma delimited which uses double-quotes as the text qualifier. I import this file into another program and perform some analysis before generating a report in Excel. The problem I've run into is one of the fields in the original file can have carriage returns/line feeds within the field. I need to remove those before I can analyze the file as it's causing problems during my import.
I've set the variable "replaceVal" to the "Chr(13)Chr(10)" which I need to replace and that works but I need to make a few changes:
I'm losing my "" around each field, is there any way around this? I need to resave the file in delimited format but the quotes around each field are not being retained.
Can this be rewritten to replace only when the "replaceVal" is found within a string of ""?
I've set the variable "replaceVal" to the "Chr(13)Chr(10)" which I need to replace and that works but I need to make a few changes:
I'm losing my "" around each field, is there any way around this? I need to resave the file in delimited format but the quotes around each field are not being retained.
Can this be rewritten to replace only when the "replaceVal" is found within a string of ""?
Code:
Worksheets("Main").Columns("A:G").Replace _
What:=replaceVal, Replacement:="", _
SearchOrder:=xlByColumns, MatchCase:=True