View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech Jim Rech is offline
external usenet poster
 
Posts: 2,718
Default Remember last selection?

Since you've written the option button values to a sheet you just need to
set those option buttons from those values in the userform's Initialize
event.

Also, it's not necessary (or user friendly) to change selected cell in a
workbook just to write values to the sheet. See the following:

Private Sub CommandButton1_Click()
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 Worksheets("Ark1").Range("A1")
.Offset(0).Value = sOne
.Offset(1).Value = sTwo
.Offset(2).Value = sThree
End With
End Sub

--
Jim
"Alen32" wrote in message
lkaboutsoftware.com...
please more help where should i put public variant