Hey Peter,
Thanks for the reply. I'm not sure how your solution works, but I
suspect I didn't give enough information so here is a bit more info.
I hope this will clear up any misunderstanding without throwing out
too much detail. I have tried to remove any actual code and leave
only the focus route, from TextBox to the Select Case I am trying to
effect.
**************************************************************************
Private Sub I_42_Change()
CellChange "I_", 42
End Sub
Private Sub I_42_Enter()
CellEnter "I_", 42, True
End Sub
Private Sub I_42_Exit(ByVal Cancel As MSForms.ReturnBoolean)
CellExit "I_", 42
End Sub
....(And all of the other 144 TextBox events)
Private Sub I_90_Change()
CellChange "I_", 90
End Sub
Private Sub I_90_Enter()
CellEnter "I_", 90
End Sub
Private Sub I_90_Exit(ByVal Cancel As MSForms.ReturnBoolean)
CellExit "I_", 90
End Sub
****************************************************************************************
These are the first three and the last three TextBox code which cover
the three main events for each TextBox (Change, Enter and Exit)
Next they are sent to the event code:
*****************************************************************************************
Public Sub CellChange(vName As Variant, vNum As Variant)
CalcBoxes vName, vNum
CellFormat vName, vNum
End Sub
Public Sub CellEnter(vName As Variant, vNum As Variant)
CellColor vName, vNum, "In"
End Sub
Public Sub CellExit(vName As Variant, vNum As Variant)
CalcBoxes vName, vNum
CellFormat vName, vNum
CellColor vName, vNum, "Out"
End Sub
***********************************************************************************
The first of the sorting subs is:
***********************************************************************************
Public Sub CalcBoxes(vName As Variant, vNum As Variant)
Select Case vName
Case "I_"
Select Case vNum
<These are the case listing I'm trying to streamline>
Case 42, 49, 56, 63, 70, 77, 84, 91
InvCol_1 vName, vNum
Case 43, 50, 57, 64, 71, 78, 85, 92
InvCol_2 vName, vNum
Case 45, 52, 59, 66, 73, 80, 87, 94
InvCol_4 vName, vNum
Case 46, 53, 60, 67, 74, 81, 88, 95
InvCol_5 vName, vNum
Case 47, 54, 61, 68, 75, 82, 89, 96
InvCol_6 vName, vNum
Case 48, 55, 62, 69, 76, 83, 90, 97
InvCol_7 vName, vNum
End Select
End Select
End Sub
*************************************************************************************
This does work as is, But I would like to stream line the code,if
possible.
Any ideas, thought or suggestions?
Any help is appreciated, Thanks.
-Minitman