+ Reply to Thread
Results 1 to 3 of 3

colouring a cell

  1. #1
    Registered User
    Join Date
    04-05-2005
    Posts
    3

    colouring a cell

    I would like a cell from a range to change colour whenever some text is entered into it.
    For example, if I type in a date or text like 'yes or no' into a cell ranging from F4:F44 then it will turn the cell colour yellow.

    Could anyone offer any help on this.

    Thanks

  2. #2
    Steve Steiner
    Guest

    RE: colouring a cell



    "andy617" wrote:

    >
    > I would like a cell from a range to change colour whenever some text is
    > entered into it.
    > For example, if I type in a date or text like 'yes or no' into a cell
    > ranging from F4:F44 then it will turn the cell colour yellow.
    >
    > Could anyone offer any help on this.
    >
    > Thanks
    >
    >
    > --
    > andy617
    > ------------------------------------------------------------------------
    > andy617's Profile: http://www.excelforum.com/member.php...o&userid=21835
    > View this thread: http://www.excelforum.com/showthread...hreadid=500150
    >
    >


  3. #3
    Steve Steiner
    Guest

    RE: colouring a cell

    Here is what I did for an application I wrote. Hope it helps and is useful:

    Public pubColors(9) As Integer

    Sub some_process1()
    Dim idxColors As Integer

    ' load up the pubColors array
    ' 0 = Black
    ' 1 = Black
    ' 2 = White
    ' 3 = Red
    ' 4 = Bright Green
    ' 5 = Blue
    ' 6 = Yellow
    ' 7 = Magenta
    ' 8 = Cyan
    ' 9 = Brown
    For idxColors = 0 To 9
    pubColors(idxColors) = idxColors
    Next idxColors

    Call some_process2()
    End Sub

    Sub some_process2()
    Dim MyColor As Integer

    MyColor = 3
    Call Color_It(MyColor)
    End Sub

    Sub some_process2()
    If [Feb05_SOD_Closed] < [Jan05_SOD_Closed] Then
    [Feb05_SOD_Closed].Font.ColorIndex = MyColor
    End If
    If [Mar05_SOD_Closed] < [Feb05_SOD_Closed] Then
    [Mar05_SOD_Closed].Font.ColorIndex = MyColor
    End If
    If [Apr05_SOD_Closed] < [Mar05_SOD_Closed] Then
    [Apr05_SOD_Closed].Font.ColorIndex = MyColor
    End If
    If [May05_SOD_Closed] < [Apr05_SOD_Closed] Then
    [May05_SOD_Closed].Font.ColorIndex = MyColor
    End If
    If [Jun05_SOD_Closed] < [May05_SOD_Closed] Then
    [Jun05_SOD_Closed].Font.ColorIndex = MyColor
    End If
    If [Jul05_SOD_Closed] < [Jun05_SOD_Closed] Then
    [Jul05_SOD_Closed].Font.ColorIndex = MyColor
    End If
    If [Aug05_SOD_Closed] < [Jul05_SOD_Closed] Then
    [Aug05_SOD_Closed].Font.ColorIndex = MyColor
    End If
    If [Sept05_SOD_Closed] < [Aug05_SOD_Closed] Then
    [Sept05_SOD_Closed].Font.ColorIndex = MyColor
    End If
    If [Oct05_SOD_Closed] < [Sept05_SOD_Closed] Then
    [Oct05_SOD_Closed].Font.ColorIndex = MyColor
    End If
    If [Nov05_SOD_Closed] < [Oct05_SOD_Closed] Then
    [Nov05_SOD_Closed].Font.ColorIndex = MyColor
    End If
    If [Dec05_SOD_Closed] < [Nov05_SOD_Closed] Then
    [Dec05_SOD_Closed].Font.ColorIndex = MyColor
    End If
    End Sub



    "andy617" wrote:

    >
    > I would like a cell from a range to change colour whenever some text is
    > entered into it.
    > For example, if I type in a date or text like 'yes or no' into a cell
    > ranging from F4:F44 then it will turn the cell colour yellow.
    >
    > Could anyone offer any help on this.
    >
    > Thanks
    >
    >
    > --
    > andy617
    > ------------------------------------------------------------------------
    > andy617's Profile: http://www.excelforum.com/member.php...o&userid=21835
    > View this thread: http://www.excelforum.com/showthread...hreadid=500150
    >
    >


+ 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