+ Reply to Thread
Results 1 to 5 of 5

Search / Replace with NewLine

  1. #1
    Registered User
    Join Date
    03-11-2009
    Location
    SF, CA
    MS-Off Ver
    Excel 2003
    Posts
    7

    Search / Replace with NewLine

    Hi there, I've been using the forum for weeks and it's been an awesome resource. Having fun leaning and applying here but I've stumbled onto an issue I can't resolve.

    I've got a text field that looks like this:

    ++ Information in bullet point 1 ++ Information in bullet point 2 ++ Information in bullet point 3

    I need a code sample that will give me an output that results in a bullet list using Char(149) to replace "++". I've tried a few things but I can't figure out how to NOT get the macro to put a 'newline' in front of the first bullet.

    The desired output would be this (where * = Char(149)):
    --
    * Information in bullet point 1
    * Information in bullet point 2
    * Information in bullet point 3
    ---
    But I keep getting:
    ----
    [extra line space]
    * Information in bullet point 1
    * Information in bullet point 2
    * Information in bullet point 3
    ---
    Can anyone help with this one!

    Thanks.

    Drew

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Search / Replace with NewLine

    =mid(substitute(a1, "++", char(10) & char(149)), 2, 1024)
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    03-11-2009
    Location
    SF, CA
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Search / Replace with NewLine

    I see. That makes sense but I'm not sure how to program that in Macro form? I'm still a noob. I'm using

    PHP Code: 
        Cells.Replace "++"vbLf 
    And this gives me a line break where I want it; but I can't seem to get the both the newline and the Char(149).

    Maybe on on the wrong track? The data is in column F is that is helpful?

    Thanks.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Search / Replace with NewLine

    Hold on, Drew. You posted the question in the programming forum, I answered you there, then you deleted that post and posted a new thread in the General forum, I answer here, now you are back to wanting a macro?

  5. #5
    Registered User
    Join Date
    03-11-2009
    Location
    SF, CA
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Search / Replace with NewLine

    Apologies. I originally posted in the "Excel Worksheet Functions" sub-forum and deleted it as I was looking for a Macro from the get-go since I'm stringing this routine together with several other features. My humble and sincere apologies for the confusion!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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