logo elektroda
logo elektroda
X
logo elektroda

EXCEL: Add Symbol at End of Each Paragraph Within Text Wrap Line, Avoid Splitting Words

amczarnowska 5724 9
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 16696187
    amczarnowska
    Level 8  
    Hello,

    I need to add a symbol at the end of each line (paragraph) in the line. I know how to add a symbol to the end of each line, but sometimes it happens that a given line consists of several lines (paragraphs) - separated by the text wrap tool. I will just add that each line can have a maximum of 60 words.
    I tried to make a function that inserts a given character after 60 words, but I don't want a given character to split a word in half.

    Sample text of one line:

    Wash your hands with soap
    After washing, wipe your hands clean
    they dry.

    I want the line to look like this after formatting

    Wash your hands with soap * /
    After washing your hands, wipe your hands so that they are * /
    they are dry * /

    I will be very grateful for your help.
  • ADVERTISEMENT
  • #2 16696437
    JRV
    VBA, Excel specialist
    = SUBST (SUB (A1; "."; "* /"); CHAR (10); "* /" & CHAR (10))
    Seems so
    but better see the attachment for a sample sheet.
  • ADVERTISEMENT
  • #3 16696596
    amczarnowska
    Level 8  
    Thank you for the information. Unfortunately, the given formula only works if you manually separate the text by using the shortcut Alt + Enter. Depends the formula would work after using the replace text button. Please see the attached file.
  • #4 16696628
    Prot
    Level 38  
    The simplest solution is to give all cells with text custom formatting to
    Code: Ini
    Log in, to see the code
    :ok:

    You will get the effect as in the screenshot:
    EXCEL: Add Symbol at End of Each Paragraph Within Text Wrap Line, Avoid Splitting Words2017-09...png Download (35.05 kB)
  • ADVERTISEMENT
  • #5 16696645
    amczarnowska
    Level 8  
    Thank you for the information. Unfortunately, such formatting introduces the given character at the end of the entire line, not at the end of each paragraph (line) in the line ...
  • #7 16697587
    JRV
    VBA, Excel specialist
    On the other hand, what practical sense of these "flags" in the text perhaps could be solved in a different way?
  • ADVERTISEMENT
  • #8 16697606
    amczarnowska
    Level 8  
    It is about proper formatting of the text, which is automatically uploaded to SAP. Excel users enter their own text, which is then automatically uploaded to SAP by clicking a button. The problem is that SAP does not accept a paragraph longer than 60 characters and rejects the text. However, if at the end of each line the mentioned early symbol is added, then SAP treats it as Excel Alt + Enter and elegantly copies everything.
    Currently, in Excel, I have a fixed line width and each user knows that at the end of each line, the symbol must be manually entered. The problem is that it is quite time-consuming ... and that's why I am looking for a solution.
  • #10 16706977
    amczarnowska
    Level 8  
    Cool! Thank you very much! :) Works perfectly :)

Topic summary

The discussion revolves around the challenge of adding a specific symbol at the end of each paragraph within a text wrap line in Excel, without splitting words. The user seeks a solution that accommodates a maximum of 60 words per line, as SAP requires this formatting for text uploads. Various suggestions are made, including using custom formatting and formulas, but these methods either apply the symbol to the entire line or require manual intervention. A user-defined function (UDF) is proposed as a potential solution, which ultimately leads to a successful implementation that meets the user's needs.
Summary generated by the language model.
ADVERTISEMENT