View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Horatio J. Bilge, Jr. Horatio J. Bilge, Jr. is offline
external usenet poster
 
Posts: 135
Default KeyDown event on form

I have a UserForm with 2 sets of Option buttons. In the frame frmHome, I have
optHome1 and optHome2. And in frmAway I have optAway1 and optAway2.

What I want to do is set it up so when a user selects optHome1, the form
automatically selects optAway2. Likewise, optHome2 would automatically select
optAway1, and vice versa.

I tried using the KeyDown event on the form, but it doesn't seem to do
anything.
Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If Me.optHome1.Value = True Then
Me.optAway2.Value = True
ElseIf Me.optHome2.Value = True Then
Me.optAway1.Value = True
End If
End Sub