+ Reply to Thread
Results 1 to 9 of 9

Help retaining formatting while using text to columns or other

  1. #1
    Registered User
    Join Date
    12-09-2016
    Location
    Florida, USA
    MS-Off Ver
    Enterprise 2016
    Posts
    5

    Help retaining formatting while using text to columns or other

    I am working on a spreadsheet that has a column full of cells that have 17 three letter ids in them. Some ids are bold while others are not. That is my company's way of designating that they are active or not.
    I am trying to split them into individual columns while retaining the bold and normal formatting of the ids. The Text to Columns function loses the formatting, and would make this project a nightmare if I have to manually reapply the formatting.
    Any ideas about how to do this would be much appreciated.
    Thanks in advance,
    Ian

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Help retaining formatting while using text to columns or other

    Is the whole cell bold or only some of the strings in a single cell? A sample workbook attached would help us understand this problem.

    I just searched the net for an "IsBold" function thinking this is what you need, if the whole cell is bold. There are posts already showing this User Defined Function*(UDF).
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Help retaining formatting while using text to columns or other

    Hi
    Try to use this function VBA in a module and use it in Excel

    Please Login or Register  to view this content.
    You can use them to mark registers as actives or you can use in conditional formatting.

  4. #4
    Registered User
    Join Date
    12-09-2016
    Location
    Florida, USA
    MS-Off Ver
    Enterprise 2016
    Posts
    5

    Post Re: Help retaining formatting while using text to columns or other

    This is a copy of the data I have. The first column needs to be split into separate columns without losing the bold/regular formatting.
    Attached Files Attached Files

  5. #5
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Help retaining formatting while using text to columns or other

    Hi
    Try this code VBA in a module
    You may need change "Bold" to another FontStyle (in the portuguese version is "Negrito")
    Please Login or Register  to view this content.
    Select the range A2:A10 (adjust as need, only one column) and run the code SplitBold.
    Note that columns B2:R10 will be overwrited.
    See the file
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    12-09-2016
    Location
    Florida, USA
    MS-Off Ver
    Enterprise 2016
    Posts
    5

    Re: Help retaining formatting while using text to columns or other

    Thank you José,

    That worked to split the cell, however it comepletely overwrites everything to the right it, even if there are more than enough spaces for it to expand.

  7. #7
    Registered User
    Join Date
    12-09-2016
    Location
    Florida, USA
    MS-Off Ver
    Enterprise 2016
    Posts
    5

    Re: Help retaining formatting while using text to columns or other

    /Thank you José,

    That worked to split the cell, however it comepletely overwrites everything to the right it, even if there are more than enough spaces for it to expand.
    I need to be able to split the first column without damaging the rest of the data. I tried to build a buffer, but that doesn't work.
    Attached Files Attached Files

  8. #8
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Help retaining formatting while using text to columns or other

    Hi
    Sorry for my mistake. It is suppost to overwrites only Columns B:R. "What the parentheses can do!"
    Try this
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    12-09-2016
    Location
    Florida, USA
    MS-Off Ver
    Enterprise 2016
    Posts
    5

    Re: Help retaining formatting while using text to columns or other

    Thank you for all of your help. I have 58 rows on over 100 sheets that will be much easier to fix now that I have this macro.

    Before this, I had no idea what macros were and that VBA even existed. Fortunately I pick up on things pretty quick. How would you recommend going about learning how to use VBA and build my own macros?

+ 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] Split comma separated text and insert into next row retaining all other columns.
    By saidineshbabu in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-17-2013, 03:25 AM
  2. Replies: 1
    Last Post: 10-13-2013, 04:01 PM
  3. Retaining formatting when using the text function
    By dotsofcolor in forum Excel General
    Replies: 2
    Last Post: 01-03-2012, 03:06 PM
  4. Retaining formatting in concatenate
    By RussellNonBrand in forum Excel General
    Replies: 2
    Last Post: 06-08-2011, 05:31 PM
  5. Converting to a text file while retaining formatting?
    By carvshner in forum Word Formatting & General
    Replies: 2
    Last Post: 03-14-2011, 12:38 PM
  6. Retaining Formatting when using (v)LOOKUP
    By ThatDamnRedhead in forum Excel General
    Replies: 3
    Last Post: 09-16-2010, 05:01 PM
  7. Transpose multiple text-based columns to single column while retaining record ids
    By SchoobsVT in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-06-2010, 12:26 PM
  8. Retaining ListBox Text Formatting
    By Chris63 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-03-2008, 01:56 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