PC Review


Reply
Thread Tools Rate Thread

Challenge - Excel Line Feed Character CHR(10) - How to Delete and keep the text formatting without going ro single line in a cell ?

 
 
Guest
Posts: n/a
 
      5th Oct 2009
Hi

Imported Text in cells are formatted with 3 line feed characters. If you
use clean() it deletes the characters and puts the text into one line. I
need to be able to delete the Chr(10)
and keep the formatting by a macro if possible.
This file is needed to be uploaded into SAP which doesn't like CHR(10).

Presently the only way to do this is to go to the end of each line and
manually delete the three CHR(10) and all works well as
the formatting stays the same.
I have tried Substitute and Find and replace, Clean() but it always ends up
in single
line....
Hope someone can help....

Thanks
Rob

 
Reply With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      5th Oct 2009
Not quite sure what you are after here. Imported (plain) text does not have
any formatting so there is no formatting to retain.

Do you want the all the text in a single cell with the 3 linefeeds (then
strip the linefeeds before uploading to SAP), or do you perhaps want text
between the linefeeds separate cells separated by two cells to simulate the
3 linefeeds, or something else.

Regards,
Peter T


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi
>
> Imported Text in cells are formatted with 3 line feed characters. If you
> use clean() it deletes the characters and puts the text into one line. I
> need to be able to delete the Chr(10)
> and keep the formatting by a macro if possible.
> This file is needed to be uploaded into SAP which doesn't like CHR(10).
>
> Presently the only way to do this is to go to the end of each line and
> manually delete the three CHR(10) and all works well as
> the formatting stays the same.
> I have tried Substitute and Find and replace, Clean() but it always ends
> up in single
> line....
> Hope someone can help....
>
> Thanks
> Rob



 
Reply With Quote
 
Guest
Posts: n/a
 
      5th Oct 2009
Hi Peter

Yes I want the all the text in a single cell with the 3 linefeeds but remove
CHR(10)
and retain text layout. Need a macro or code to do this. ( maybe Subsitute
or replace )
Can do it manually, but need to auto it. When exported it comes over already
formatted with CHR(10)
so need to remove these and keep the text layout.
I need the strip program as you suggest.

"Peter T" <peter_t@discussions> wrote in message
news:(E-Mail Removed)...
> Not quite sure what you are after here. Imported (plain) text does not
> have any formatting so there is no formatting to retain.
>
> Do you want the all the text in a single cell with the 3 linefeeds (then
> strip the linefeeds before uploading to SAP), or do you perhaps want text
> between the linefeeds separate cells separated by two cells to simulate
> the 3 linefeeds, or something else.
>
> Regards,
> Peter T
>
>
> <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Hi
>>
>> Imported Text in cells are formatted with 3 line feed characters. If you
>> use clean() it deletes the characters and puts the text into one line.
>> I need to be able to delete the Chr(10)
>> and keep the formatting by a macro if possible.
>> This file is needed to be uploaded into SAP which doesn't like CHR(10).
>>
>> Presently the only way to do this is to go to the end of each line and
>> manually delete the three CHR(10) and all works well as
>> the formatting stays the same.
>> I have tried Substitute and Find and replace, Clean() but it always ends
>> up in single
>> line....
>> Hope someone can help....
>>
>> Thanks
>> Rob

>
>

 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      5th Oct 2009
> Yes I want the all the text in a single cell with the 3 linefeeds but
> remove CHR(10)


It's the CHR(10) character in the text that instructs the line feed.
Depending on where your 3 line breaks exist, with cell wrapping and loads of
spaces inserted in the right places maybe you could simulate the same visual
text layout with no line breaks. Doable but a lot of work.

Why not simply remove the linefeeds (and replace with spaces if/as required)
before uploading to SAP.

Regards,
Peter T

Curiosity, why is it a problem for SAP to receive line breaks (and
presumably carriage returns & tabs etc)

<(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi Peter
>
> Yes I want the all the text in a single cell with the 3 linefeeds but
> remove CHR(10)
> and retain text layout. Need a macro or code to do this. ( maybe
> Subsitute or replace )
> Can do it manually, but need to auto it. When exported it comes over
> already formatted with CHR(10)
> so need to remove these and keep the text layout.
> I need the strip program as you suggest.
>
> "Peter T" <peter_t@discussions> wrote in message
> news:(E-Mail Removed)...
>> Not quite sure what you are after here. Imported (plain) text does not
>> have any formatting so there is no formatting to retain.
>>
>> Do you want the all the text in a single cell with the 3 linefeeds (then
>> strip the linefeeds before uploading to SAP), or do you perhaps want text
>> between the linefeeds separate cells separated by two cells to simulate
>> the 3 linefeeds, or something else.
>>
>> Regards,
>> Peter T
>>
>>
>> <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> Hi
>>>
>>> Imported Text in cells are formatted with 3 line feed characters. If
>>> you
>>> use clean() it deletes the characters and puts the text into one line.
>>> I need to be able to delete the Chr(10)
>>> and keep the formatting by a macro if possible.
>>> This file is needed to be uploaded into SAP which doesn't like CHR(10).
>>>
>>> Presently the only way to do this is to go to the end of each line and
>>> manually delete the three CHR(10) and all works well as
>>> the formatting stays the same.
>>> I have tried Substitute and Find and replace, Clean() but it always
>>> ends up in single
>>> line....
>>> Hope someone can help....
>>>
>>> Thanks
>>> Rob

>>
>>



 
Reply With Quote
 
Guest
Posts: n/a
 
      6th Oct 2009
Hi Peter
This works but end up with single line... need to keep the text on separate
lines as below.
at the end of each line there is a "I" black line which I assume is Chr(10)
As mentioned I can go in and manually delete these with no problems, text
formating stays same.
This may not be able to be automated ??
I Could record a macro but the text is different depending on the contact..
Sample Text as follows

Please contact the requestor to arrange shipping. Do not contact our freight
forwarders directly.
Contact : MICHAEL MANTRA
Ph: +61 3 9999 1161
(E-Mail Removed)

Cheers and many thanks for your help
Rob

<(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> Hi Peter
>
> Yes I want the all the text in a single cell with the 3 linefeeds but
> remove CHR(10)
> and retain text layout. Need a macro or code to do this. ( maybe
> Subsitute or replace )
> Can do it manually, but need to auto it. When exported it comes over
> already formatted with CHR(10)
> so need to remove these and keep the text layout.
> I need the strip program as you suggest.
>
> "Peter T" <peter_t@discussions> wrote in message
> news:(E-Mail Removed)...
>> Not quite sure what you are after here. Imported (plain) text does not
>> have any formatting so there is no formatting to retain.
>>
>> Do you want the all the text in a single cell with the 3 linefeeds (then
>> strip the linefeeds before uploading to SAP), or do you perhaps want text
>> between the linefeeds separate cells separated by two cells to simulate
>> the 3 linefeeds, or something else.
>>
>> Regards,
>> Peter T
>>
>>
>> <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> Hi
>>>
>>> Imported Text in cells are formatted with 3 line feed characters. If
>>> you
>>> use clean() it deletes the characters and puts the text into one line.
>>> I need to be able to delete the Chr(10)
>>> and keep the formatting by a macro if possible.
>>> This file is needed to be uploaded into SAP which doesn't like CHR(10).
>>>
>>> Presently the only way to do this is to go to the end of each line and
>>> manually delete the three CHR(10) and all works well as
>>> the formatting stays the same.
>>> I have tried Substitute and Find and replace, Clean() but it always
>>> ends up in single
>>> line....
>>> Hope someone can help....
>>>
>>> Thanks
>>> Rob

>>
>>

 
Reply With Quote
 
Guest
Posts: n/a
 
      7th Oct 2009
Hi Peter

Have solved the problem
used code

Sub ClearChr13()
Cells.Replace What:=Chr(13), Replacement:=Chr(32), LookAt:=xlPart,
SearchOrder:=xlByRows, MatchCase:=True

End Sub

All works ok

Thanks for your help
Rob

<(E-Mail Removed)> wrote in message
news:eDUKJ#(E-Mail Removed)...
> Hi Peter
> This works but end up with single line... need to keep the text on
> separate lines as below.
> at the end of each line there is a "I" black line which I assume is
> Chr(10)
> As mentioned I can go in and manually delete these with no problems, text
> formating stays same.
> This may not be able to be automated ??
> I Could record a macro but the text is different depending on the
> contact..
> Sample Text as follows
>
> Please contact the requestor to arrange shipping. Do not contact our
> freight forwarders directly.
> Contact : MICHAEL MANTRA
> Ph: +61 3 9999 1161
> (E-Mail Removed)
>
> Cheers and many thanks for your help
> Rob
>
> <(E-Mail Removed)> wrote in message
> news:#(E-Mail Removed)...
>> Hi Peter
>>
>> Yes I want the all the text in a single cell with the 3 linefeeds but
>> remove CHR(10)
>> and retain text layout. Need a macro or code to do this. ( maybe
>> Subsitute or replace )
>> Can do it manually, but need to auto it. When exported it comes over
>> already formatted with CHR(10)
>> so need to remove these and keep the text layout.
>> I need the strip program as you suggest.
>>
>> "Peter T" <peter_t@discussions> wrote in message
>> news:(E-Mail Removed)...
>>> Not quite sure what you are after here. Imported (plain) text does not
>>> have any formatting so there is no formatting to retain.
>>>
>>> Do you want the all the text in a single cell with the 3 linefeeds (then
>>> strip the linefeeds before uploading to SAP), or do you perhaps want
>>> text between the linefeeds separate cells separated by two cells to
>>> simulate the 3 linefeeds, or something else.
>>>
>>> Regards,
>>> Peter T
>>>
>>>
>>> <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> Hi
>>>>
>>>> Imported Text in cells are formatted with 3 line feed characters. If
>>>> you
>>>> use clean() it deletes the characters and puts the text into one line.
>>>> I need to be able to delete the Chr(10)
>>>> and keep the formatting by a macro if possible.
>>>> This file is needed to be uploaded into SAP which doesn't like CHR(10).
>>>>
>>>> Presently the only way to do this is to go to the end of each line and
>>>> manually delete the three CHR(10) and all works well as
>>>> the formatting stays the same.
>>>> I have tried Substitute and Find and replace, Clean() but it always
>>>> ends up in single
>>>> line....
>>>> Hope someone can help....
>>>>
>>>> Thanks
>>>> Rob
>>>
>>>

 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      7th Oct 2009
Great, thanks for letting us know

Regards,
Peter Thornton

<(E-Mail Removed)> wrote in message news:%
> Hi Peter
>
> Have solved the problem

<snip>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Line Feed Character - How to delete the CHR(10) and keep the formatting without going to single line.. Microsoft Excel Discussion 7 7th Oct 2009 11:13 AM
Challenge - Excel Line Feed Character CHR(10) - How to Delete and keep the text formatting without going ro single line in a cell ? Microsoft Excel Worksheet Functions 7 7th Oct 2009 11:10 AM
How can I insert a line feed in the text in an EXCEL cell? =?Utf-8?B?QW50aW9uaW8=?= Microsoft Excel Misc 2 15th Feb 2006 10:59 AM
How to put line feed in a cell using a character not Alt/Enter =?Utf-8?B?RGF2aWQgQ3Jvd3RoZXI=?= Microsoft Excel Misc 1 3rd Oct 2005 06:59 PM
Forcing a line feed in a text cell? =?Utf-8?B?U2hhbmUgRG93ZA==?= Microsoft Excel Misc 2 17th May 2004 09:11 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:31 PM.