itortu
asked on
replace carriage return with \&lf;
How do I replace a carriage return character from an excel cell?
This is how I assign the cell contents:
xComments = Cells(CurrRow, 5)
the cell can contian:
This is just a test of
carriage returns issue
on Batch Insert/Update
I need to replace the carriage return with \&lf;
so this way when the contents of the excel sheet are written to a script that will perform a insert, the contents would still read the same way:
This is just a test of
carriage returns issue
on Batch Insert/Update
This is how I assign the cell contents:
xComments = Cells(CurrRow, 5)
the cell can contian:
This is just a test of
carriage returns issue
on Batch Insert/Update
I need to replace the carriage return with \&lf;
so this way when the contents of the excel sheet are written to a script that will perform a insert, the contents would still read the same way:
This is just a test of
carriage returns issue
on Batch Insert/Update
In a cell it uses the vertical tab as I think its called anyway NOT vbcrlf but char(10)-sheet or CHR(10)-vba
xComments = Trim$(Replace(Cells(CurrRo w, 5), chr(10), "\&lf;"))
Chris
xComments = Trim$(Replace(Cells(CurrRo
Chris
Also just confirmed the constant associated with chr(10) is vblf i.e. if you prefer:
xComments = Trim$(Replace(Cells(CurrRo w, 5), vblf, "\&lf;"))
Chris
xComments = Trim$(Replace(Cells(CurrRo
Chris
ASKER
Hi Chris,
You are right I was using the wrong constant. I found that out on the post made by Darius on this forum:http://www.developerfusion.com/forum/thread/23605/
One question, would that line still work when the white square is found in one of the cells?
Is there a way to check the text string for carriage return or the white square, or a line feed within an if statement and apply the appropriate formatting?
Thank you.
You are right I was using the wrong constant. I found that out on the post made by Darius on this forum:http://www.developerfusion.com/forum/thread/23605/
One question, would that line still work when the white square is found in one of the cells?
Is there a way to check the text string for carriage return or the white square, or a line feed within an if statement and apply the appropriate formatting?
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
GAme-master,
I think you will find the question was already answered at the second post and confirmed in the fourth one, it is as such awaiting the author closure.
Chris
I think you will find the question was already answered at the second post and confirmed in the fourth one, it is as such awaiting the author closure.
Chris
Chris...
I used chr(13) and I think none of the post states it though...
If the question already answered, my apology though...
game-master
ASKER
I am giving game-mster 50 points for taking the time to look at the question and offer a legit solution. I hope this does not upset you Chris.
Thank you very much for your help.
Thank you very much for your help.
itortu
For why could I be upset ... they are your points to do with as you please. My comment earlier to game-master was because vbcr = chr(13) and vblf=chr(10).
However the use of the chr method was new information in the post so whilst less clear in terms of what it was doing it was a reasonable alternative approach and as such it is fair that you rewarded the information hence "for why could I be upset"
See you around
Chris
For why could I be upset ... they are your points to do with as you please. My comment earlier to game-master was because vbcr = chr(13) and vblf=chr(10).
However the use of the chr method was new information in the post so whilst less clear in terms of what it was doing it was a reasonable alternative approach and as such it is fair that you rewarded the information hence "for why could I be upset"
See you around
Chris
ASKER
but it does not work.