+ Reply to Thread
Results 1 to 6 of 6

Excel 2003 cell background color

  1. #1
    Dan E
    Guest

    Excel 2003 cell background color

    Is there a way in Excel 2003 to have specific text content of cells set the
    color of the background? e.g. all cells containing "RA" have a light green
    background, "RB" have light blue.... etc., for a small set of text values.
    TIA

    Dan
    --
    Dan E
    webbie(removethis)@preferredcountry.com



  2. #2
    Gord Dibben
    Guest

    Re: Excel 2003 cell background color

    Dan

    Conditional Formatting will give you 4 formats including the default format.

    Look under Format>CF and Cell Value is:


    Gord Dibben Excel MVP

    On Sun, 23 Jan 2005 16:30:07 -0600, "Dan E"
    <webbie(removethis)@preferredcountry.com> wrote:

    >Is there a way in Excel 2003 to have specific text content of cells set the
    >color of the background? e.g. all cells containing "RA" have a light green
    >background, "RB" have light blue.... etc., for a small set of text values.
    >TIA
    >
    >Dan



  3. #3
    Dan E
    Guest

    Re: Excel 2003 cell background color

    Many thanks, Gord - that will give me a good start. Is there anything I
    might do with a macro, that might for example examine the cell contents then
    set the color depending on what it finds?

    Thanks again,

    Dan
    "Gord Dibben" <gorddibbATshawDOTca> wrote in message
    news:[email protected]...
    > Dan
    >
    > Conditional Formatting will give you 4 formats including the default
    > format.
    >
    > Look under Format>CF and Cell Value is:
    >
    >
    > Gord Dibben Excel MVP
    >
    > On Sun, 23 Jan 2005 16:30:07 -0600, "Dan E"
    > <webbie(removethis)@preferredcountry.com> wrote:
    >
    >>Is there a way in Excel 2003 to have specific text content of cells set
    >>the
    >>color of the background? e.g. all cells containing "RA" have a light
    >>green
    >>background, "RB" have light blue.... etc., for a small set of text values.
    >>TIA
    >>
    >>Dan

    >




  4. #4
    Gord Dibben
    Guest

    Re: Excel 2003 cell background color

    Dan

    Adjust text and colors to suit and just keep adding "Cases" until you're
    happy.

    Note: as written, will find only whole text.

    e.g. "my cat eats snakes" would not be formatted.

    Sub Color_Text()
    Dim Cell As Range
    Dim col As Integer
    On Error GoTo ws_exit
    For Each Cell In Selection
    Select Case LCase(Cell.Value)
    Case "dog": col = 1
    Case "cat": col = 5
    Case "snake": col = 10
    Case "bird": col = 19
    Case "fish": col = 20
    Case Else: col = 3
    End Select
    Cell.Interior.ColorIndex = col
    Next
    ws_exit:
    End Sub


    Gord

    On Sun, 23 Jan 2005 17:41:43 -0600, "Dan E"
    <webbie(removethis)@preferredcountry.com> wrote:

    >Many thanks, Gord - that will give me a good start. Is there anything I
    >might do with a macro, that might for example examine the cell contents then
    >set the color depending on what it finds?
    >
    >Thanks again,
    >
    >Dan
    >"Gord Dibben" <gorddibbATshawDOTca> wrote in message
    >news:[email protected]...
    >> Dan
    >>
    >> Conditional Formatting will give you 4 formats including the default
    >> format.
    >>
    >> Look under Format>CF and Cell Value is:
    >>
    >>
    >> Gord Dibben Excel MVP
    >>
    >> On Sun, 23 Jan 2005 16:30:07 -0600, "Dan E"
    >> <webbie(removethis)@preferredcountry.com> wrote:
    >>
    >>>Is there a way in Excel 2003 to have specific text content of cells set
    >>>the
    >>>color of the background? e.g. all cells containing "RA" have a light
    >>>green
    >>>background, "RB" have light blue.... etc., for a small set of text values.
    >>>TIA
    >>>
    >>>Dan

    >>

    >



  5. #5
    Dan E
    Guest

    Re: Excel 2003 cell background color

    That looks pretty neat - thanks, Gord.

    Dan
    "Gord Dibben" <gorddibbATshawDOTca> wrote in message
    news:[email protected]...
    > Dan
    >
    > Adjust text and colors to suit and just keep adding "Cases" until you're
    > happy.
    >
    > Note: as written, will find only whole text.
    >
    > e.g. "my cat eats snakes" would not be formatted.
    >
    > Sub Color_Text()
    > Dim Cell As Range
    > Dim col As Integer
    > On Error GoTo ws_exit
    > For Each Cell In Selection
    > Select Case LCase(Cell.Value)
    > Case "dog": col = 1
    > Case "cat": col = 5
    > Case "snake": col = 10
    > Case "bird": col = 19
    > Case "fish": col = 20
    > Case Else: col = 3
    > End Select
    > Cell.Interior.ColorIndex = col
    > Next
    > ws_exit:
    > End Sub
    >
    >
    > Gord
    >
    > On Sun, 23 Jan 2005 17:41:43 -0600, "Dan E"
    > <webbie(removethis)@preferredcountry.com> wrote:
    >
    >>Many thanks, Gord - that will give me a good start. Is there anything I
    >>might do with a macro, that might for example examine the cell contents
    >>then
    >>set the color depending on what it finds?
    >>
    >>Thanks again,
    >>
    >>Dan
    >>"Gord Dibben" <gorddibbATshawDOTca> wrote in message
    >>news:[email protected]...
    >>> Dan
    >>>
    >>> Conditional Formatting will give you 4 formats including the default
    >>> format.
    >>>
    >>> Look under Format>CF and Cell Value is:
    >>>
    >>>
    >>> Gord Dibben Excel MVP
    >>>
    >>> On Sun, 23 Jan 2005 16:30:07 -0600, "Dan E"
    >>> <webbie(removethis)@preferredcountry.com> wrote:
    >>>
    >>>>Is there a way in Excel 2003 to have specific text content of cells set
    >>>>the
    >>>>color of the background? e.g. all cells containing "RA" have a light
    >>>>green
    >>>>background, "RB" have light blue.... etc., for a small set of text
    >>>>values.
    >>>>TIA
    >>>>
    >>>>Dan
    >>>

    >>

    >




  6. #6
    Sanat Agrawal
    Guest

    Re: Excel 2003 cell background color

    Use conditional formatting

    Regs
    Sanat

    "Dan E" <webbie(removethis)@preferredcountry.com> wrote in message
    news:%[email protected]...
    > Is there a way in Excel 2003 to have specific text content of cells set

    the
    > color of the background? e.g. all cells containing "RA" have a light

    green
    > background, "RB" have light blue.... etc., for a small set of text values.
    > TIA
    >
    > Dan
    > --
    > Dan E
    > webbie(removethis)@preferredcountry.com
    >
    >




+ 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