+ Reply to Thread
Results 1 to 4 of 4

Macro to create a new line within a text string if specific characters appear mid-string

  1. #1
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Macro to create a new line within a text string if specific characters appear mid-string

    hi everyone,

    I have the following code:

    Please Login or Register  to view this content.
    What this code is supposed to do, is go through each cells in the ranges specified. If the text strings in the cell contains a && the a new line after the && is created and bringing the remaining string to the right of the && with it. I do not get an error with this only, only it doesn't actually seem to do anything.

    So here's the effect:

    Current (in a single cell):
    The sun is out && The sun is out

    Desired result (in a single cell):

    The sun is out
    The sun is out

    Any ideas?

    Thanks everyone!

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Macro to create a new line within a text string if specific characters appear mid-stri

    Try simply:
    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Macro to create a new line within a text string if specific characters appear mid-stri

    Olly,

    You, good sir, are a genius. Thanks very much

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Macro to create a new line within a text string if specific characters appear mid-stri

    Happy to help. Thanks for the feedback.

+ 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] Macro to convert specific text and format specific text within a string
    By Mencae in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 12-06-2012, 12:13 AM
  2. Replies: 8
    Last Post: 08-07-2012, 10:15 AM
  3. Searching for Text String and copying specific portion based on characters
    By undergraduate in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-30-2010, 12:45 PM
  4. search for specific characters in text string and separate them out
    By neowok in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-09-2008, 09:21 AM
  5. [SOLVED] Text String - Specific Characters
    By Kiser in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-09-2006, 10:50 PM

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