+ Reply to Thread
Results 1 to 2 of 2

how to format only a specific character or number in each cell withina range of cells

  1. #1
    Colleen
    Guest

    how to format only a specific character or number in each cell withina range of cells

    I am sending this to several Excel newsgroups, because I am not sure
    which one if the most appropriate. I apologize in advance for the
    multiple postings. I have MS Excel 2000 (version 9.0.3821 SR-1). How
    can I format only a selected character or number within each cell in a
    specific range of cells? For instance if I have a cell containing
    “1234234”, how can I format it so that only the 2’s are bold or are
    colored? Obviously, I have a range of cells, and I want to format all
    the 2’s occurring in any of the cells as either bold or colored.
    Conditional formatting does not seem to allow me to do this, and I have
    been unable to find a formula that will accomplish this. Can someone help?
    Thank you.
    Colleen

  2. #2
    Bernie Deitrick
    Guest

    Re: how to format only a specific character or number in each cell within a range of cells

    Colleen,

    You can't do this to numbers that are actual numbers, but if you don't mind converting your numbers
    to strings, you can select the cells and run the macro below.

    HTH,
    Bernie
    MS Excel MVP

    Sub Macro1()
    Dim myCell As Range
    Dim myStart As Integer
    For Each myCell In Selection
    myCell.Value = "'" & myCell.Value
    myStart = 1
    While InStr(myStart, myCell.Value, "2") > 0
    myStart = InStr(myStart, myCell.Value, "2")
    With myCell.Characters(Start:=myStart, Length:=1).Font
    .FontStyle = "Bold"
    .ColorIndex = 3
    End With
    myStart = myStart + 1
    Wend
    Next myCell
    End Sub

    "Colleen" <[email protected]> wrote in message
    news:Z%[email protected]...
    >I am sending this to several Excel newsgroups, because I am not sure which one if the most
    >appropriate. I apologize in advance for the multiple postings. I have MS Excel 2000 (version
    >9.0.3821 SR-1). How can I format only a selected character or number within each cell in a
    >specific range of cells? For instance if I have a cell containing “1234234”, how can I format it
    >so that only the 2’s are bold or are colored? Obviously, I have a range of cells, and I want to
    >format all the 2’s occurring in any of the cells as either bold or colored. Conditional formatting
    >does not seem to allow me to do this, and I have been unable to find a formula that will accomplish
    >this. Can someone help?
    > Thank you.
    > Colleen




+ 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