Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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


--
andy617
------------------------------------------------------------------------
andy617's Profile: http://www.excelforum.com/member.php...o&userid=21835
View this thread: http://www.excelforum.com/showthread...hreadid=500150

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IF funtion to result in cell colouring Peta Excel Worksheet Functions 1 January 9th 09 01:39 PM
colouring cell KHAN Excel Discussion (Misc queries) 2 August 2nd 08 09:42 PM
COLOURING CELL BACK GROUNDS Tassie Devil Excel Discussion (Misc queries) 2 March 16th 07 01:53 AM
no grid lines when colouring in a cell stevec Excel Discussion (Misc queries) 2 July 12th 06 06:06 PM
Automatic cell colouring Chris01623 Excel Worksheet Functions 1 May 9th 06 02:55 PM


All times are GMT +1. The time now is 05:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"