+ Reply to Thread
Results 1 to 15 of 15

Can you preserve formatting like bold and color when concatenating

  1. #1
    Registered User
    Join Date
    05-23-2020
    Location
    USA
    MS-Off Ver
    2010 Microsoft Office
    Posts
    39

    Can you preserve formatting like bold and color when concatenating

    Excel 2007 in Windows 10.

    I wish to concatenate the text data in 2 columns. That is easy to do using the formula =CONCATENATE(A2, ". ", B2).
    My question concerns preserving the existing text formatting during the concatenation.

    In my attached example, the content in Column A is formatted as "Bold" and in "Red".
    The concatenation results I get using the standard formula are seen in column E. As can be seen the formatting present in column A is lost.

    Is it possible to preserve into the concatenated results, the Bold and Red formatting present in column A ?
    The desired result is shown in column G.

    If yes, how?

    Thank you.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,097

    Re: Can you preserve formatting like bold and color when concatenating

    A formula cannot see formatting, so it cannot be done with a formula.

  3. #3
    Registered User
    Join Date
    05-23-2020
    Location
    USA
    MS-Off Ver
    2010 Microsoft Office
    Posts
    39

    Re: Can you preserve formatting like bold and color when concatenating

    Thank you for the quick reply.

    Is there another way to do it in Excel?

    The final formatted result will ultimately be transferred into a Word document (in case that makes a difference in the process).

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,097

    Re: Can you preserve formatting like bold and color when concatenating

    You could use a macro, but the cell would have to be text & not a formula.

  5. #5
    Registered User
    Join Date
    05-23-2020
    Location
    USA
    MS-Off Ver
    2010 Microsoft Office
    Posts
    39

    Re: Can you preserve formatting like bold and color when concatenating

    I don't mind using a macro if it will do the trick. But I have no idea how to do that either. I'm not an expert Excel user.

    What would the macro contain? Could you give me an example using the data in the spreadsheet I uploaded? That would be terrific.

    The end result should be a column containing
    a) the formatted text from column A
    b) followed by a period and space (. )
    c) followed by the text in column B
    Thank you so much!

  6. #6
    Registered User
    Join Date
    05-23-2020
    Location
    USA
    MS-Off Ver
    2010 Microsoft Office
    Posts
    39

    Re: Can you preserve formatting like bold and color when concatenating

    Also, the spreadsheet I am working on has 80,000 rows. Can the process be automated?
    Thanks.

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,097

    Re: Can you preserve formatting like bold and color when concatenating

    How about
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    05-23-2020
    Location
    USA
    MS-Off Ver
    2010 Microsoft Office
    Posts
    39

    Re: Can you preserve formatting like bold and color when concatenating

    You are extremely kind and I am very grateful.

    But please tell me how do I use the code you created for me? What do I do with it to make it do its magic? Where do I put it and invoke it?

    Remember that I am a relative Excel newbie and this spreadsheet has 80,000 rows. How do I implement the solution you so kindly provided?

  9. #9
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,097

    Re: Can you preserve formatting like bold and color when concatenating

    To see how to add & run macros, have a look here
    https://www.ablebits.com/office-addi...a-macro-excel/

  10. #10
    Registered User
    Join Date
    05-23-2020
    Location
    USA
    MS-Off Ver
    2010 Microsoft Office
    Posts
    39

    Re: Can you preserve formatting like bold and color when concatenating

    Please ignore. My fault. Macro worked perfectly.
    Attached Images Attached Images
    Last edited by Andrews493; 08-08-2020 at 01:47 PM.

  11. #11
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,097

    Re: Can you preserve formatting like bold and color when concatenating

    Glad to hear that & thanks for the feedback.

  12. #12
    Registered User
    Join Date
    05-23-2020
    Location
    USA
    MS-Off Ver
    2010 Microsoft Office
    Posts
    39

    Re: Can you preserve formatting like bold and color when concatenating

    Sorry to have bothered you unnecessarily. I was busy with other things and did not try the macro till now.

    One of the errors I made is that I had the wrong excel file open when I created the macro and the macro was then saved with the wrong name. That is why I could not find it in the Alt F8 dialog, before I discovered my error and searched for it in the "all open workbooks" in the Alt F8 dialog box. I suppose I could now simply create the macro anew with the correct excel file open but is there a way to simply rename or move the macro?

  13. #13
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,097

    Re: Can you preserve formatting like bold and color when concatenating

    You can just copy/paste it to a module in the correct workbook, just remember to save it is as macro enabled.

  14. #14
    Registered User
    Join Date
    05-23-2020
    Location
    USA
    MS-Off Ver
    2010 Microsoft Office
    Posts
    39

    Re: Can you preserve formatting like bold and color when concatenating

    Thank you.

  15. #15
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,097

    Re: Can you preserve formatting like bold and color when concatenating

    My pleasure.

+ 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. Add a row and preserve cell formatting
    By buhaj47 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-25-2018, 09:17 AM
  2. Preserve Fill Color External Data Connection
    By morerockin in forum Excel General
    Replies: 2
    Last Post: 06-14-2016, 12:11 AM
  3. How to preserve text formatting
    By dstin44 in forum Excel General
    Replies: 3
    Last Post: 11-07-2015, 03:17 PM
  4. Mouse rolls over to cell will change the tab color, font color and tp bold type
    By Rocky2013 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-20-2013, 10:36 AM
  5. Trying to preserve label format (color) when refreshing
    By easycapital in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-01-2008, 06:47 PM
  6. 03/07 Preserve Formatting
    By traci_marie in forum Excel General
    Replies: 0
    Last Post: 09-15-2007, 12:14 PM
  7. Preserve Formatting
    By [email protected] in forum Excel General
    Replies: 7
    Last Post: 07-29-2005, 01:05 AM

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