+ Reply to Thread
Results 1 to 4 of 4

find word in a cell then change cell format

  1. #1

    find word in a cell then change cell format

    I want to find some words in cells

    and then change the color of cell if find.

    eg. a cell contain "hello I am moto"
    if macro find "am" then change the cell color

    anybody know how to write the macro ?
    Thanks


  2. #2
    Forum Contributor
    Join Date
    03-03-2005
    Posts
    315
    Try:

    Sub FindAndFormat()
    Set rng = ActiveSheet.UsedRange
    For Each c In rng
    If c.Value Like "*Cowboy*" Then
    c.font.color=vbblue
    End If
    Next


    This will format blue all cells containing only "Cowboy" or any expression including "Cowboy".

    david

  3. #3

    Re: find word in a cell then change cell format


    If InStr(1, Range("A1").Value, "am") > 0 Then
    Range("E3").Interior.ColorIndex = 1
    End If

    Try this.


  4. #4
    Jim May
    Guest

    Re: find word in a cell then change cell format

    Use Conditional Formatting using this formula
    after selecting Formula is:

    =ISNUMBER(FIND("am",A1,1))

    Color accordingly

    HTH


    <[email protected]> wrote in message
    news:[email protected]...
    > I want to find some words in cells
    >
    > and then change the color of cell if find.
    >
    > eg. a cell contain "hello I am moto"
    > if macro find "am" then change the cell color
    >
    > anybody know how to write the macro ?
    > Thanks
    >




+ 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