How to assign value to colors for dummies

southernsquid

Board Regular
Joined
May 19, 2011
Messages
60
I have a simple speadsheet for hundreds of people and I am just filling cells with red or green when tasks are complete. I want to track progress by percentage, but I first need to assing each color a value. Green=100 and Red=0. I can then average the rows after that. How do I assign the values to a color? Thanks
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
That is Conditional Formatting.

Select the range you want to color, go into Conditional Formatting,
Cell Value is equal to 0, format fill as red
Cell Value is equal to 100, format fill as green
 
Upvote 0
Hot Pepper, thanls for the response. I can do Conditional Formatting which I don't believe this is. I don't want to enter a value in the cell, I want to fill it with a color and have excel apply a value to that color. Can anyone help?
Thanks
 
Upvote 0
Coloring a cell doesn't fire any event code.
You could color the cell then run a macro to fill in the values if that is acceptable.

You didn't specify your range, so I used UsedRange, alter to suit:

Code:
Sub test()
Dim c As Range, clr As Long
For Each c In ActiveSheet.UsedRange.Cells
    If IsNumeric(c) And c <> "" Then
        Select Case c
            Case 0: MsgBox "Got Here": clr = RGB(34, 173, 31)
            Case 100: clr = vbRed
            Case Else: clr = xlNone
        End Select
        c.Interior.color = clr
    End If
Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,728
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top