LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

Where is says Case 4, change that to Case n where n is the number that you
want to trigger a green.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"F7772" wrote in message
...
Thank you, the Case function has me confused, let's say I want it green,
where do i use the Index as 10? Cheers.

"Bob Phillips" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "B1:B10"

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Select Case .Value
Case 200: .Interior.ColorIndex = 3 'red
Case 2: .Interior.ColorIndex = 6 'yellow
Case 3: .Interior.ColorIndex = 5 'blue
Case 4: .Interior.ColorIndex = 10 'green
Case 5: .Interior.ColorIndex = 1
End Select
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.




--

HTH

RP
(remove nothere from the email address if mailing direct)


"F7772" wrote in message
...
I have a spreadsheet that populates a number of cells. The user has

the
option to change the cell values. Now, ifthe user changes a value, I

want
the
value to be of a different colour.

Say the code-generated value of cell B1 is 137 (black colour)
if the user changes the value to 200, I want the colour to be red

Is this possible?

Thanks in advance...






 
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
Change colour of Text if number in cell exceed limit Lewis Koh Excel Worksheet Functions 2 August 2nd 05 02:16 AM
Input cell information RB Camp Excel Discussion (Misc queries) 3 May 18th 05 05:49 PM
16 digit number wont keep alteration unless format cell to text Croc001 Excel Discussion (Misc queries) 3 March 30th 05 09:12 AM
Histograms: how change number of bins [email protected] Excel Discussion (Misc queries) 2 January 31st 05 02:07 AM
how to change the state of a number in a cell from negative to po. Steve11 Excel Discussion (Misc queries) 1 November 29th 04 07:00 AM


All times are GMT +1. The time now is 12:08 AM.

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

About Us

"It's about Microsoft Excel"