+ Reply to Thread
Results 1 to 4 of 4

Need a function to concatenated cell preserving the color in the source text

  1. #1
    Registered User
    Join Date
    06-19-2005
    Posts
    49

    Need a function to concatenated cell preserving the color in the source text

    I have text in several cells that are different colored text. I want to concatenate all these different texts into one cell preserving their source colors in the concatenation USING A FUNCTION. Is there a function that someone has programmed that I can use? Thank you.

  2. #2
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: Need a function to concatenated cell preserving the color in the source text

    If you mean as a UDF, then I don't think it's possible because a UDF can only return a value; it can't do cell formatting of any kind, including text colouring.

    As a VBA function/subroutine called from VBA on the other hand, then yes. For each source cell, loop through the Characters object one character at a time, copying the Text and various Font properties to the destination cell.

  3. #3
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Need a function to concatenated cell preserving the color in the source text

    Can you post a dummy workbook? I have a macro that does something a little bit more complicated, but might be able to ajust it to fit your needs... No promises but might be worth a shot
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  4. #4
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Need a function to concatenated cell preserving the color in the source text

    Solution posted at: http://www.vbaexpress.com/forum/showthread.php?t=41386

    See the message to forum cross posters by Ken Puls: http://www.excelguru.ca/node/7

+ 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