![]() |
|
#3
|
|||
|
|||
|
If need be, you can get the RGB values with this.
Select a colored cell and run this code. Use this in the "Maybe_With_RGB()" macro Code:
Sub ShowColour()
Dim RGBColour As String, R As Integer, G As Integer, B As Integer, c As Range
RGBColour = Right("000000" & Hex(Selection.Interior.Color), 6)
R = WorksheetFunction.Hex2Dec(Right(RGBColour, 2))
G = WorksheetFunction.Hex2Dec(Mid(RGBColour, 3, 2))
B = WorksheetFunction.Hex2Dec(Left(RGBColour, 2))
MsgBox "RGB(" & R & ", " & G & ", " & B & ")"
End Sub
Code:
Sub Maybe_With_RGB()
Dim c As Range
For Each c In Range("A1:D12") '<----- Change to actual used colored range
With c
Select Case .Interior.Color
Case Is = RGB(255, 0, 0) '<----- Change to what you get for Red
c.Value = -1
Case Is = RGB(0, 255, 0) '<----- Change to what you get for Green
c.Value = 1
Case Is = RGB(255, 255, 0) '<----- Change to what you get for Yellow
c.Value = 0
Case Else
End Select
End With
Next c
End Sub
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help making invoices easier | wbowles | Office | 0 | 07-17-2013 10:39 AM |
Please help me with an easier solution!
|
Inquisitor | Word | 1 | 06-26-2011 01:01 AM |
| Easier highlighting? | atarei | Word | 0 | 08-27-2010 05:28 PM |
| Microsoft Word Easier Navigation Question | xxlegendxx | Word | 0 | 03-22-2009 07:44 PM |