A
Alen32
I have this code where user choose one of nine option button. I want my
program to remember last selection.
here is code:
Private Sub CommandButton1_Click()
Worksheets("Ark1").Activate
Range("A1").Select
With UserForm1
If .OptionButton1 Then sOne = "1"
If .OptionButton2 Then sOne = "2"
If .OptionButton3 Then sOne = "3"
If .OptionButton4 Then sTwo = "1"
If .OptionButton5 Then sTwo = "2"
If .OptionButton6 Then sTwo = "3"
If .OptionButton7 Then sThree = "1"
If .OptionButton8 Then sThree = "2"
If .OptionButton9 Then sThree = "3"
End With
With ActiveCell
Offset(0, 0).Value = sOne
Offset(1, 0).Value = sTwo
Offset(2, 0).Value = sThree
End With
End Sub
program to remember last selection.
here is code:
Private Sub CommandButton1_Click()
Worksheets("Ark1").Activate
Range("A1").Select
With UserForm1
If .OptionButton1 Then sOne = "1"
If .OptionButton2 Then sOne = "2"
If .OptionButton3 Then sOne = "3"
If .OptionButton4 Then sTwo = "1"
If .OptionButton5 Then sTwo = "2"
If .OptionButton6 Then sTwo = "3"
If .OptionButton7 Then sThree = "1"
If .OptionButton8 Then sThree = "2"
If .OptionButton9 Then sThree = "3"
End With
With ActiveCell
Offset(0, 0).Value = sOne
Offset(1, 0).Value = sTwo
Offset(2, 0).Value = sThree
End With
End Sub