Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
treetop40
 
Posts: n/a
Default Can I rate a cell 1-5 and colour code it?

I would like to be able to give a cell a rating of 1-5 and colour coded but
conditional formatting in excel 2002 only allows up to 3, by using 1 number
as white cell means you can using a rating of 1-4. I required 1-5. I have
tried to use coloured drop down menus but the cell colours do not carry
across.
Therefore can anyone tell me how I can type a number of 1 to 5 in a cell and
that it will also show as a colour.
--
Many thanks
Jackie
--

  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Jackie,

Try event code

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1:A10")) Is Nothing Then
With Target
Select Case .Value
Case 1: .Interior.ColorIndex = 3
Case 2: .Interior.ColorIndex = 5
Case 3: .Interior.ColorIndex = 6
Case 4: .Interior.ColorIndex = 10
Case 5: .Interior.ColorIndex = 35
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

Bob Phillips

"treetop40" wrote in message
...
I would like to be able to give a cell a rating of 1-5 and colour coded

but
conditional formatting in excel 2002 only allows up to 3, by using 1

number
as white cell means you can using a rating of 1-4. I required 1-5. I

have
tried to use coloured drop down menus but the cell colours do not carry
across.
Therefore can anyone tell me how I can type a number of 1 to 5 in a cell

and
that it will also show as a colour.
--
Many thanks
Jackie
--



  #3   Report Post  
treetop40
 
Posts: n/a
Default

Thanks Phillip, but I do not understand event code, or able to follow your
reply, is it possible to explain in laymans terms please.
--
Thanks
Jackie


"Bob Phillips" wrote:

Jackie,

Try event code

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1:A10")) Is Nothing Then
With Target
Select Case .Value
Case 1: .Interior.ColorIndex = 3
Case 2: .Interior.ColorIndex = 5
Case 3: .Interior.ColorIndex = 6
Case 4: .Interior.ColorIndex = 10
Case 5: .Interior.ColorIndex = 35
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

Bob Phillips

"treetop40" wrote in message
...
I would like to be able to give a cell a rating of 1-5 and colour coded

but
conditional formatting in excel 2002 only allows up to 3, by using 1

number
as white cell means you can using a rating of 1-4. I required 1-5. I

have
tried to use coloured drop down menus but the cell colours do not carry
across.
Therefore can anyone tell me how I can type a number of 1 to 5 in a cell

and
that it will also show as a colour.
--
Many thanks
Jackie
--




  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

If you follow the instructions in the original post, and then try putting a
value in A1 you should see it work.

Regards

Bob

"treetop40" wrote in message
...
Thanks Phillip, but I do not understand event code, or able to follow your
reply, is it possible to explain in laymans terms please.
--
Thanks
Jackie


"Bob Phillips" wrote:

Jackie,

Try event code

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1:A10")) Is Nothing Then
With Target
Select Case .Value
Case 1: .Interior.ColorIndex = 3
Case 2: .Interior.ColorIndex = 5
Case 3: .Interior.ColorIndex = 6
Case 4: .Interior.ColorIndex = 10
Case 5: .Interior.ColorIndex = 35
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

Bob Phillips

"treetop40" wrote in message
...
I would like to be able to give a cell a rating of 1-5 and colour

coded
but
conditional formatting in excel 2002 only allows up to 3, by using 1

number
as white cell means you can using a rating of 1-4. I required 1-5. I

have
tried to use coloured drop down menus but the cell colours do not

carry
across.
Therefore can anyone tell me how I can type a number of 1 to 5 in a

cell
and
that it will also show as a colour.
--
Many thanks
Jackie
--






  #5   Report Post  
treetop40
 
Posts: n/a
Default

Thanks that work great help. Do you have a colour code for the numbers to
use also please
--
Thanks
Jackie


"Bob Phillips" wrote:

If you follow the instructions in the original post, and then try putting a
value in A1 you should see it work.

Regards

Bob

"treetop40" wrote in message
...
Thanks Phillip, but I do not understand event code, or able to follow your
reply, is it possible to explain in laymans terms please.
--
Thanks
Jackie


"Bob Phillips" wrote:

Jackie,

Try event code

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1:A10")) Is Nothing Then
With Target
Select Case .Value
Case 1: .Interior.ColorIndex = 3
Case 2: .Interior.ColorIndex = 5
Case 3: .Interior.ColorIndex = 6
Case 4: .Interior.ColorIndex = 10
Case 5: .Interior.ColorIndex = 35
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

Bob Phillips

"treetop40" wrote in message
...
I would like to be able to give a cell a rating of 1-5 and colour

coded
but
conditional formatting in excel 2002 only allows up to 3, by using 1
number
as white cell means you can using a rating of 1-4. I required 1-5. I
have
tried to use coloured drop down menus but the cell colours do not

carry
across.
Therefore can anyone tell me how I can type a number of 1 to 5 in a

cell
and
that it will also show as a colour.
--
Many thanks
Jackie
--









  #6   Report Post  
Bob Phillips
 
Posts: n/a
Default

You used to be able to type Colorindex Property in VBA help and it would
list them, but that is not working on this XP version.

Run this codelet, it will list them on the active sheet.

Sub Colors()
Dim i As Long
For i = 1 To 56
Cells(i, "A").Value = i
Cells(i, "B").Interior.ColorIndex = i
Next i
End Sub

--
HTH

Bob Phillips

"treetop40" wrote in message
...
Thanks that work great help. Do you have a colour code for the numbers to
use also please
--
Thanks
Jackie


"Bob Phillips" wrote:

If you follow the instructions in the original post, and then try

putting a
value in A1 you should see it work.

Regards

Bob

"treetop40" wrote in message
...
Thanks Phillip, but I do not understand event code, or able to follow

your
reply, is it possible to explain in laymans terms please.
--
Thanks
Jackie


"Bob Phillips" wrote:

Jackie,

Try event code

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1:A10")) Is Nothing Then
With Target
Select Case .Value
Case 1: .Interior.ColorIndex = 3
Case 2: .Interior.ColorIndex = 5
Case 3: .Interior.ColorIndex = 6
Case 4: .Interior.ColorIndex = 10
Case 5: .Interior.ColorIndex = 35
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

Bob Phillips

"treetop40" wrote in message
...
I would like to be able to give a cell a rating of 1-5 and colour

coded
but
conditional formatting in excel 2002 only allows up to 3, by using

1
number
as white cell means you can using a rating of 1-4. I required

1-5. I
have
tried to use coloured drop down menus but the cell colours do not

carry
across.
Therefore can anyone tell me how I can type a number of 1 to 5 in

a
cell
and
that it will also show as a colour.
--
Many thanks
Jackie
--









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
Cell color based upon cell value My View Excel Discussion (Misc queries) 11 July 6th 05 03:59 AM
cell color index comparison MINAL ZUNKE New Users to Excel 1 June 30th 05 07:11 AM
Copy cell format to cell on another worksht and update automatical kevinm Excel Worksheet Functions 21 May 19th 05 11:07 AM
Changing Cell Fill Colour Nick Excel Discussion (Misc queries) 4 December 6th 04 10:05 PM
Function to return colour of formatted cell ExcelMonkey Excel Worksheet Functions 3 November 1st 04 05:54 PM


All times are GMT +1. The time now is 10:07 AM.

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"