Closed Thread
Results 1 to 5 of 5

Bold some of the cell contents

  1. #1
    Brad
    Guest

    Bold some of the cell contents

    Thanks for taking the time to read my question.

    It is possible to apply the Bold font setting to an entire cell. It is also
    possible to apply the Bold setting to portions of text in a cell and leave
    the remaining portions unbolded (if that's a word...).

    How can you do that in VBA?

    Ex:

    Activecell.value = "The Number Is 550055"

    I want "550055" to be bold, and the rest not bold.

    How do I do this in VBA?

    Thanks,

    Brad

  2. #2
    Tom Ogilvy
    Guest

    Re: Bold some of the cell contents

    ActiveCell.Characters(15,6).Font.Bold = True

    worked for me.

    --
    Regards,
    Tom Ogilvy



    "Brad" <[email protected]> wrote in message
    news:[email protected]...
    > Thanks for taking the time to read my question.
    >
    > It is possible to apply the Bold font setting to an entire cell. It is

    also
    > possible to apply the Bold setting to portions of text in a cell and leave
    > the remaining portions unbolded (if that's a word...).
    >
    > How can you do that in VBA?
    >
    > Ex:
    >
    > Activecell.value = "The Number Is 550055"
    >
    > I want "550055" to be bold, and the rest not bold.
    >
    > How do I do this in VBA?
    >
    > Thanks,
    >
    > Brad




  3. #3
    JE McGimpsey
    Guest

    Re: Bold some of the cell contents

    one way:

    Const sPREFIX = "The Number Is "
    With ActiveCell
    .Value = sPREFIX & 550055
    .Characters(Len(sPREFIX) + 1).Font.Bold = True
    End With




    In article <[email protected]>,
    "Brad" <[email protected]> wrote:

    > Thanks for taking the time to read my question.
    >
    > It is possible to apply the Bold font setting to an entire cell. It is also
    > possible to apply the Bold setting to portions of text in a cell and leave
    > the remaining portions unbolded (if that's a word...).
    >
    > How can you do that in VBA?
    >
    > Ex:
    >
    > Activecell.value = "The Number Is 550055"
    >
    > I want "550055" to be bold, and the rest not bold.
    >
    > How do I do this in VBA?


  4. #4
    Chip Pearson
    Guest

    Re: Bold some of the cell contents

    Try something like

    Dim Pos As Integer
    ActiveCell.Value = "The number is 123"
    Pos = InStrRev(ActiveCell.Value, " ")
    ActiveCell.Characters(Pos + 1, 999).Font.Bold = True



    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com



    "Brad" <[email protected]> wrote in message
    news:[email protected]...
    > Thanks for taking the time to read my question.
    >
    > It is possible to apply the Bold font setting to an entire
    > cell. It is also
    > possible to apply the Bold setting to portions of text in a
    > cell and leave
    > the remaining portions unbolded (if that's a word...).
    >
    > How can you do that in VBA?
    >
    > Ex:
    >
    > Activecell.value = "The Number Is 550055"
    >
    > I want "550055" to be bold, and the rest not bold.
    >
    > How do I do this in VBA?
    >
    > Thanks,
    >
    > Brad




  5. #5
    Brad
    Guest

    Re: Bold some of the cell contents

    Perfect Tom!

    Thanks,

    Brad

    "Tom Ogilvy" wrote:

    > ActiveCell.Characters(15,6).Font.Bold = True
    >
    > worked for me.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    >
    > "Brad" <[email protected]> wrote in message
    > news:[email protected]...
    > > Thanks for taking the time to read my question.
    > >
    > > It is possible to apply the Bold font setting to an entire cell. It is

    > also
    > > possible to apply the Bold setting to portions of text in a cell and leave
    > > the remaining portions unbolded (if that's a word...).
    > >
    > > How can you do that in VBA?
    > >
    > > Ex:
    > >
    > > Activecell.value = "The Number Is 550055"
    > >
    > > I want "550055" to be bold, and the rest not bold.
    > >
    > > How do I do this in VBA?
    > >
    > > Thanks,
    > >
    > > Brad

    >
    >
    >


Closed 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