Color by Numbers Random Test Compare

Published:

Updated:

S - Scale

MNL - Minnesota Pick 3 Sample for 2011-12-20 to 2012-01-28

RT0 to RT9 - 10 Random Tests for Excel Generated Numbers

 

Excel VB Sub to change cell color

__________

Sub Change0to9BackColor()
    Dim InsideColor(9) As Long
    Dim SelectedRange As String
    Dim RangeRowCount, RangeColumnCount, c, r As Long
    SelectedRange = ActiveWindow.RangeSelection.Address
    RangeRowCount = Range(SelectedRange).Rows.Count
    RangeColumnCount = Range(SelectedRange).Columns.Count
    InsideColor(0) = RGB(255, 64, 96)
    InsideColor(1) = RGB(255, 128, 0)
    InsideColor(2) = RGB(255, 196, 64)
    InsideColor(3) = RGB(255, 255, 0)
    InsideColor(4) = RGB(0, 255, 0)
    InsideColor(5) = RGB(0, 255, 128)
    InsideColor(6) = RGB(0, 192, 255)
    InsideColor(7) = RGB(128, 128, 255)
    InsideColor(8) = RGB(192, 64, 255)
    InsideColor(9) = RGB(255, 64, 192)
    For c = 1 To RangeColumnCount
        For r = 1 To RangeRowCount
            If Int(Range(SelectedRange).Cells(r, c).Value) >= 0 And Int(Range(SelectedRange).Cells(r, c).Value) <= 9 And Range(SelectedRange).Cells(r, c) <> "" Then
                Range(SelectedRange).Cells(r, c).Interior.Color = InsideColor(Int(Range(SelectedRange).Cells(r, c).Value))
            End If
        Next r
    Next c
End Sub

___________

Entry #2,394

Comments

This Blog entry currently has no comments.

Post a Comment

Please Log In

To use this feature you must be logged into your Lottery Post account.

Not a member yet?

If you don't yet have a Lottery Post account, it's simple and free to create one! Just tap the Register button and after a quick process you'll be part of our lottery community.

Register