Thread: [Solved] Check box values to text
View Single Post
 
Old 10-14-2013, 12:05 PM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Code:
Private Sub CommandButton1_Click()
Dim oCtr As Control
Dim strComposite As String
  For Each oCtr In Me.Controls
    Select Case TypeName(oCtr)
      Case "CheckBox"
        If oCtr.Value = True Then
          If strComposite = vbNullString Then
            strComposite = oCtr.Name & " is checked"
          Else
            strComposite = strComposite & ", " & oCtr.Name & " is checked"
          End If
        End If
      End Select
  Next oCtr
  'Replace this statement with code that writes the string variable to your bookmark.
  MsgBox strComposite
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote