OptionButton with Bookmark text output

Joined
Jul 19, 2018
Messages
1
Reaction score
0
Hello, in UserForm, I have 2 option buttons for gender, they are in same groupname, how do I allow user to select back and forth on their option button without the text output accumulating? instead of OB1 should delete OB2 if previously selected?
Right now if you select the buttons more than 2 times you get 'malefemalemale' and does not remove the previous txt selection.

Private Sub OptionButton1_Click()
Dim GENDER As Range
Set GENDER = ActiveDocument.Bookmarks("GENDER").Range
GENDER.Text = "male"
End Sub

Private Sub OptionButton2_Click()
Dim GENDER As Range
Set GENDER = ActiveDocument.Bookmarks("GENDER").Range
GENDER.Text = "female"
End Sub

Thanks in advance, yes this is very basic.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top