+ Reply to Thread
Results 1 to 6 of 6

Bold-face a sub-string

  1. #1
    Registered User
    Join Date
    05-11-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2007
    Posts
    7

    Bold-face a sub-string

    Hello all,

    From what I gathered after researching, there is not a formula which you can apply conditional formatting to a cell's values, partially. I am working on a spreadsheet that contains a lot of numbers with relevant information in parenthesis. Sometimes, there will be multiple numbers or IDs in the same cell. I was wondering if anyone knows of a VBA formula that basically does this: bold-face all values not in parenthesis in a range of cells. I'd appreciate any help you guys can lend!

    Example of what I am looking for:
    Cell A1 values: "12345 (Kang, 4/4/57)"
    Cell A2 values: "12355 (Andrew, 6/26/86) 99999 (Young, 5/29/58)"

    Thanks,
    Andrew

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Bold-face a sub-string

    Try
    Please Login or Register  to view this content.

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Bold-face a sub-string

    Andrew

    This works with your sample data.
    Please Login or Register  to view this content.
    To use it open the VBE (ALT+F11), goto Insert>Module and paste the code in the newly created module.

    Then close the VBA (ALT+Q), goto the Developer tab. click Macros, select BoldIDs and then click run.
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    05-11-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Bold-face a sub-string

    Thanks, guys, for your suggestions/help! I left the office several minutes ago, and I will test your codes as soon as I return. For the same workbook, I employ the UDF, lookup_concat, which segways into my next question. Do I need to keep the lookup_concat function and your conditional formatting coding in two separate modules, or am I supposed to add your suggestion(s) to the module that already contains the lookup_concat? Sorry, I am brand new to VBA.

    By the way, if it makes any difference, after I get the results I need using the lookup_concat function, I get rid of the formula in the cells, by copying and pasting only the values to avoid using too many resources. Yes, my workbook contains extreme amounts of data.
    Last edited by andrew06; 06-25-2013 at 06:29 AM.

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Bold-face a sub-string

    You can have the code I posted in the same module as the concat function.

    It will only work on values, not formulas so you would run it after you've replaced the formulas with values.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Bold-face a sub-string

    Try the attached
    Attached Files Attached Files

+ 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