G
Graham
Hi,
I'm afraid I am a complete VBA novice, so apologies if this
is a dead simple question to you guys out there!
The problem I have is that I need to migrate a flat file
containing data that is variable length, comma delimited
with each field quotated, into an Excel spreadsheet.
However many of the fields contain "carriage returns" (CR)
within the data.
e.g.:
"ID","FIELDA","FIELDB","COMMENT","LASTFIELD"
"1234","ABC","DEF","No carriage return comment","XYZ"
"1235","SDF","HJK","A comment with a carriage return.
Next line of comment.","MNB"
"1236","DFG","ERT","Another normal comment","JKL"
I would therefore like to write a macro that does the
following:
Start Loop
Find the next line that does not start with '"'
End of File? Yes, Stop, No, Carry on.
Backspace to delete the CR,
insert space
Go to Start Loop.
If someone could provide me with Word/Excel VB code to do
this, I would be very grateful.
Thanks,
Graham
I'm afraid I am a complete VBA novice, so apologies if this
is a dead simple question to you guys out there!
The problem I have is that I need to migrate a flat file
containing data that is variable length, comma delimited
with each field quotated, into an Excel spreadsheet.
However many of the fields contain "carriage returns" (CR)
within the data.
e.g.:
"ID","FIELDA","FIELDB","COMMENT","LASTFIELD"
"1234","ABC","DEF","No carriage return comment","XYZ"
"1235","SDF","HJK","A comment with a carriage return.
Next line of comment.","MNB"
"1236","DFG","ERT","Another normal comment","JKL"
I would therefore like to write a macro that does the
following:
Start Loop
Find the next line that does not start with '"'
End of File? Yes, Stop, No, Carry on.
Backspace to delete the CR,
insert space
Go to Start Loop.
If someone could provide me with Word/Excel VB code to do
this, I would be very grateful.
Thanks,
Graham