this was what got me started using VBA. within excel conditional formating will let you have or setup 3 conditions. for Pick4 I wanted 4 so that i could enter my guess and see where those # had occured recently. this file assumes you have pick4 data or any numeric data starting at row 4 col B,C,D,E through 40 you culd have much more but unless you change some numbers thats all it will look at. open your spreadsheet press alt f11 create a macro lets call it color. this creates an empty subroutine. copy and paste (type it if your a glutton for punishment) the file below then x out to your spreadsheet. Now F8 and select color to see it work enter your 4 # choices press enter after each . if you get that far we can talk about setting a command button
enjoy
p8
Range("A1:d30").Select 'selects range of cells
' Selection.ClearContents' removes any numbers that might be there
' Selection.Interior.ColorIndex = 0 ' removes any color you might have had
' this will let you input 4 numbers to use the "red" "data" are info to you type=1 tells the program ' that its a number type 2 would be text
c2 = Application.InputBox("Red", "data", Type:=1)
c3 = Application.InputBox("Blue ", "data", Type:=1)
c4 = Application.InputBox("Green", "data", Type:=1)
c5 = Application.InputBox("Yellow", "data", Type:=1)
'type = 1, for integers'
' this takes the data you entered and puts it on your spreadsheet row 2 col 2,3,4,5
Cells(2, 1).Value = c2
Cells(2, 2).Value = c3
Cells(2, 3).Value = c4
Cells(2, 4).Value = c5
For x = 4 To 40 ' ROW 4 THRU 40
For y = 1 To 4 ' COL BCDE
If Cells(2, 1) = Cells(x, y) Then Cells(x, y).Interior.ColorIndex = 3
If Cells(2, 2) = Cells(x, y) Then Cells(x, y).Interior.ColorIndex = 4
If Cells(2, 3) = Cells(x, y) Then Cells(x, y).Interior.ColorIndex = 5
If Cells(2, 4) = Cells(x, y) Then Cells(x, y).Interior.ColorIndex = 6
Next y
Next x '