View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
fedude fedude is offline
external usenet poster
 
Posts: 74
Default generic checkbox click form event handler?

Here is the routine I'm writing for each of the checkboxes. I'm unsure how
to genericize this so I can create control names from the name of the
checkbox.


Suggestions?
-----------------------------------------------

Private Sub Q1062_Click()
Dim player As Integer

'capture the unique number
player = Right(S1062.Name, 4)

S1062.Value = ""
If Q1062.Value = True Then
L1062.Tag = L1062.Caption
L1062.Caption = "Substitute"
S1062.Enabled = False
S1062.BackColor = &H8000000B
Else
L1062.Caption = L1062.Tag
S1062.Enabled = True
S1062.BackColor = &H80000005
End If
End Sub