VBA UserForm for Word Mulitple checkboxes not all displaying on document

  • Thread starter Thread starter Legacy 234612
  • Start date Start date
Status
Not open for further replies.
L

Legacy 234612

Guest
I have created a userform in word via VBA code. I have several checkboxes I have grouped into different frames. I want a user to be able to select multiple checkboxes and have the captions returned next to one bookmark value separated by commas, but only one checkbox displays for me when I check them all. Can anyone tell me how to do this? I am new to vba code so really not sure how to accomplish this. I think maybe I need a string?

Private Sub CmbSubmit_Click()
Dim SSN As Range
Set SSN = ActiveDocument.Bookmarks("SSN").Range
SSN.Text = Me.TbxSSN.Value

Dim oCtrl As Control
Dim NeededForms As Range
Set NeededForms = ActiveDocument.Bookmarks("NeededForms").Range

For Each oCtrl In NeededForms1.Controls
If TypeName(oCtrl) = "CheckBox" Then
If oCtrl.Value = True Then
NeededForms.Text = oCtrl.Caption
Exit For
End If
End If
Next oCtrl
Unload Me
Repaint
End Sub
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Upvote 0
Nevertheless, the rules here - and the expected etiquette everywhere - is that you provide the relevant links on all sites where you cross-post.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top