+ Reply to Thread
Results 1 to 8 of 8

Adding Line Break after specific character

Hybrid View

  1. #1
    Registered User
    Join Date
    05-16-2019
    Location
    London, England
    MS-Off Ver
    2016
    Posts
    54

    Adding Line Break after specific character

    Previously when trying to accomplish this I have gone into Find & Replace and looked for whatever is the catalyst for the line break and then done 'Replace with' ctrl+j

    But in this instance it isn't working, so if there's a way to resolve with a formula then that would be so helpful.

    Essentially my data is something like this


    Ford Focus, Mondeo, Kuga >. Toyota Avensis, Celica, Rav 4 >. Kia Picanto, Ceed >.



    and I want the data to look like this:

    Focus Focus, Mondey, Kuga

    Toyota Avensis, Celica, Rav 4

    Kia Picanto, Ceed


    So I want it to look for the >. and then introduce a line break (CHAR10?) in there.

    If anyones able to help that would be so much appreciated.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,311

    Re: Adding Line Break after specific character

    Try:
    Formula: copy to clipboard
    =SUBSTITUTE(A1, ">.", CHAR(10))
    and Wrap Text
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    05-16-2019
    Location
    London, England
    MS-Off Ver
    2016
    Posts
    54

    Re: Adding Line Break after specific character

    This works a treat! But to take it one step further, how would I add two line breaks instead of one?
    Last edited by AliGW; 05-24-2022 at 04:23 AM. Reason: PLEASE don't quote unnecessarily!

  4. #4
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Adding Line Break after specific character

    You should be able to use something like this:

    =SUBSTITUTE($A1," >. ",CHAR(10))
    But you'll have to make sure the cell in which you place the formula has "Wrap text" enabled. Use Ctrl+1 on the cell, select the Alignment tab and check the box.

    WBD
    Office 365 on Windows 11, looking for rep!

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,691

    Re: Adding Line Break after specific character

    Try this:

    =SUBSTITUTE(A1, ">.", CHAR(10)CHAR(10))
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,311

    Re: Adding Line Break after specific character

    Try:
    Formula: copy to clipboard
    =SUBSTITUTE(A1, ">.", CHAR(10) & CHAR(10))

  7. #7
    Registered User
    Join Date
    05-16-2019
    Location
    London, England
    MS-Off Ver
    2016
    Posts
    54

    Re: Adding Line Break after specific character

    Thank you

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,311

    Re: Adding Line Break after specific character

    You're welcome. Thanks for the rep.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Insert a line break within a cell after a specific character
    By skifizzo in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-08-2020, 07:03 AM
  2. Replies: 25
    Last Post: 07-12-2016, 05:46 PM
  3. Replies: 12
    Last Post: 06-22-2016, 01:11 PM
  4. Adding line break
    By biznez in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-17-2015, 05:01 PM
  5. Unicode character creates a line break
    By mikke in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-15-2015, 08:48 PM
  6. [SOLVED] Break a line of text at specfied character count
    By kazphilips in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-14-2013, 12:45 AM
  7. Macro Add line break after character
    By Tybalt in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-01-2013, 09:08 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1