+ Reply to Thread
Results 1 to 6 of 6

Replace hyphenated prefix of concatenated columns removing to much

  1. #1
    Forum Contributor
    Join Date
    07-11-2010
    Location
    Minneapolis, USA
    MS-Off Ver
    Excel 2016
    Posts
    308

    Replace hyphenated prefix of concatenated columns removing to much

    I have multiple dynamically created concatenated column.

    The data in the columns all have prefix's and I do not know in advance of running the code what the prefix's are, the data in the the columns look like:

    Please Login or Register  to view this content.
    Or

    Please Login or Register  to view this content.
    etc...

    I need to remove all the hyphenated prefix's so it looks like:

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    I am using the replace code below but the
    Please Login or Register  to view this content.
    is removing every thing before the last concatenated element i.e I end up with
    Please Login or Register  to view this content.
    and
    Please Login or Register  to view this content.
    Not sure how to write the Replace part to work in this instance

    Thanks

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by capson; 12-14-2015 at 03:38 PM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,631

    Re: Replace hyphenated prefix of concatenated columns removing to much

    Please Login or Register  to view this content.
    Ben Van Johnson

  3. #3
    Forum Contributor
    Join Date
    07-11-2010
    Location
    Minneapolis, USA
    MS-Off Ver
    Excel 2016
    Posts
    308

    Re: Replace hyphenated prefix of concatenated columns removing to much

    Thanks Ben,

    The code works only for the first instance of the prefix I get this

    Please Login or Register  to view this content.
    But need
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    07-11-2010
    Location
    Minneapolis, USA
    MS-Off Ver
    Excel 2016
    Posts
    308

    Re: Replace hyphenated prefix of concatenated columns removing to much

    In further effort my code works with a two step process

    first
    Please Login or Register  to view this content.
    Then
    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Replace hyphenated prefix of concatenated columns removing to much

    Hi..

    Try this one too.. seemed to work on the data you provided.

    Click the button on the "Test" sheet.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    07-11-2010
    Location
    Minneapolis, USA
    MS-Off Ver
    Excel 2016
    Posts
    308

    Re: Replace hyphenated prefix of concatenated columns removing to much

    Thanks apo that works great
    Last edited by capson; 12-14-2015 at 11:24 PM.

+ 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. Replies: 7
    Last Post: 09-29-2014, 01:02 AM
  2. Removing a prefix
    By nscherneck in forum Excel General
    Replies: 1
    Last Post: 11-02-2012, 05:52 PM
  3. vba to Match concatenated values in concatenated columns
    By bjurick in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-28-2012, 03:45 PM
  4. Removing prefix in number range
    By [email protected] in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-01-2011, 10:44 AM
  5. Replace one prefix with another prefix
    By uglyduck in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-23-2010, 08:24 PM
  6. Removing 1- prefix in phone #'s
    By TBeverson in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-09-2009, 04:23 PM
  7. Removing a Prefix from Text in a Cell
    By inktec in forum Excel General
    Replies: 6
    Last Post: 04-10-2007, 04:25 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