Results 1 to 5 of 5

Thread: Function for BOLD format

  1. #1

    Function for BOLD format


    Please, is there any function in Excel for BOLD format?

    I have a formula like this...

    ="There are "&B10&" users in the room now!"

    I want only the "number of users (B10)" in BOLD format, so I'd like to know if there's a function to do that. It would be something like this...

    ="There are "&BOLD(B10)&" users in the room now!"

    If there's not, how could I create this function in VBA?

    A friend of mine told me it's impossible to do. But, wouldn't it be the same process of the functions UPPER(range) and LOWER(range)? I mean, if it's possible to deal with upper or lower cases using functions, maybe it's possible to deal with bold format as well, ain't it? Am I wrong?

    When the value of a cell is a text, it's possible to put bold format only for the words we want, instead of putting for the (entire) cell intself. But when the cell has a formula, that's not possible anymore. That's why I thought about a function.

    Is it really impossible?

    Thanks for the attention, guys.


    Last edited by brunces; 07-13-2005 at 06:53 AM. Reason: Edited for addtional comments.

  2. #2
    Hmm.....I don't know if it can be done the exact way you want it, and I don't know which cell is supposed to say "There are a x number of users in the room now!" but here's a sample.

    Option Explicit 
    Private Sub Worksheet_Calculate() 
        Dim r As Range 
        Dim r2 As Range 
        Set r = Range("B10") 
        Set r2 = Range("C10") 
        Application.EnableEvents = False 
        r.Offset(, 1).Value = "There are " & r.Value & " users in the room now!" 
        With r2 
            .Characters(InStr(r2.Value, r), Len(CStr(r))).Font.FontStyle = "Bold" 
        End With 
        Application.EnableEvents = True 
    End Sub 
    Formatting tags added by mark007
    Justin Labenne

  3. #3
    VBAX Tutor
    May 2004
    Germany, Dresden
    Hi Justin,
    and do you know a way to do this while the cell to format actually contains a formula? Because here at EE ( this does not seem so.


  4. #4
    What I've got above is the only thing I have ever been able to come up with as a workaround to this question.

    I have not come up with any rational ideas as to how to go about changing formatting within a formula. Most resposnes on the boards from MrExcel, etc.. say it cannot be done, and I am pretty much going to mark it as impossible.

    I have attempted custom number formats, etc.. but never spent a lot of time it because it just does not seem possible or even if, reliable.

    Now that that is said, someone will post and prove me wrong.
    Justin Labenne

  5. #5
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    May 2004
    Another workaround.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.

    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts