Thread: Radio Button
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Radio Button

Put this in the UserForm code module.

Private Sub OptionButton1_Click()
If Me.OptionButton1 = True Then
Sheets("Laptop 1").Activate
End If
End Sub

Private Sub OptionButton2_Click()
If Me.OptionButton1 = True Then
Sheets("Laptop 2").Activate
End If
End Sub

"zak" wrote:

Hi

I have a form with 2 radio buttons; one for Laptop 1 and the other for
Laptop 2. Also on the form are some text input fields which is generic to
both laptop 1 and 2.

My question is, based on the radio button selected, i'd like to copy the
information entered into the text fields on the form to the respective
worksheet (worksheet Laptop 1 or worksheet Laptop 2).

I'm not sure how to say If radio button 1 is selected,then write the info to
worksheet Laptop 1 or If radio button 2 is selected then write the info to
worksheet Laptop 2.

I look forward to any help. Thank you