Mr.G
06-03-2009, 05:01 AM
Just wondering why does the first option button call the msgbox? It should select the offset.
Private Sub CommandButton1_Click()
If OptionButtion1 Then
ActiveCell.Offset(0, 2).Activate
ElseIf OptionButton7 Then
ActiveCell.Offset(, 3).Activate
ElseIf OptionButton6 Then
ActiveCell.Offset(, 4).Activate
ElseIf OptionButton5 Then
ActiveCell.Offset(, 5).Activate
ElseIf OptionButton4 Then
ActiveCell.Offset(, 6).Activate
ElseIf OptionButton3 Then
ActiveCell.Offset(, 7).Activate
ElseIf OptionButton9 Then
ActiveCell.Offset(, 8).Activate
ElseIf OptionButton13 Then
ActiveCell.Offset(, 9).Activate
ElseIf OptionButton12 Then
ActiveCell.Offset(, 10).Activate
ElseIf OptionButton11 Then
ActiveCell.Offset(, 11).Activate
ElseIf OptionButton10 Then
ActiveCell.Offset(, 12).Activate
ElseIf OptionButton8 Then
ActiveCell.Offset(, 13).Activate
Else
MsgBox "Please select one"
End If
TextBox1 = ActiveCell.Value
End Sub
Thank you
Private Sub CommandButton1_Click()
If OptionButtion1 Then
ActiveCell.Offset(0, 2).Activate
ElseIf OptionButton7 Then
ActiveCell.Offset(, 3).Activate
ElseIf OptionButton6 Then
ActiveCell.Offset(, 4).Activate
ElseIf OptionButton5 Then
ActiveCell.Offset(, 5).Activate
ElseIf OptionButton4 Then
ActiveCell.Offset(, 6).Activate
ElseIf OptionButton3 Then
ActiveCell.Offset(, 7).Activate
ElseIf OptionButton9 Then
ActiveCell.Offset(, 8).Activate
ElseIf OptionButton13 Then
ActiveCell.Offset(, 9).Activate
ElseIf OptionButton12 Then
ActiveCell.Offset(, 10).Activate
ElseIf OptionButton11 Then
ActiveCell.Offset(, 11).Activate
ElseIf OptionButton10 Then
ActiveCell.Offset(, 12).Activate
ElseIf OptionButton8 Then
ActiveCell.Offset(, 13).Activate
Else
MsgBox "Please select one"
End If
TextBox1 = ActiveCell.Value
End Sub
Thank you