time*treat
I feel that i'm making progress till i hit a wall. this code does what i want it to. question is how to terminate and shut it down you can see my intent was to enter a # larger than 9 as my trigger. what i'm trying doesnot work and i have been unable to find an example to guide me. thaks for your help and patience.
Sub color()
test = True
Call clear_color
Do While test = True
Call set_guess
Call clear_color
Call set_color
If test = False Then Exit Sub
Loop
Exit Sub
End Sub
Sub set_color()
For X = 4 To 30 ' ROW 4 THRU 30
For Y = 2 To 5 ' COL BCDE
If Cells(2, 2) = Cells(X, Y) Then Cells(X, Y).Interior.ColorIndex = 3
If Cells(2, 3) = Cells(X, Y) Then Cells(X, Y).Interior.ColorIndex = 4
If Cells(2, 4) = Cells(X, Y) Then Cells(X, Y).Interior.ColorIndex = 5
If Cells(2, 5) = Cells(X, Y) Then Cells(X, Y).Interior.ColorIndex = 6
Next Y
Next X
End Sub
Public Sub set_guess()
'Public Sub input_box_example()
'by time*treat'
c2 = Application.InputBox("col B", "data", Type:=1)
If c2 > 9 Then GoTo done
c3 = Application.InputBox("col C", "data", Type:=1)
c4 = Application.InputBox("col D", "data", Type:=1)
c5 = Application.InputBox("col E", "data", Type:=1)
'type = 1, for integers'
Cells(2, 2).Value = c2
Cells(2, 3).Value = c3
Cells(2, 4).Value = c4
Cells(2, 5).Value = c5
End Sub
Sub clear_color()
For X = 4 To 30 ' ROW 4 THRU 30
For Y = 2 To 5 ' COL BCDE
Cells(X, Y).Interior.ColorIndex = 0
Cells(X, Y).Interior.ColorIndex = 0
Cells(X, Y).Interior.ColorIndex = 0
Cells(X, Y).Interior.ColorIndex = 0
Next Y
Next X
End Sub