Pookiemeister
Well-known Member
- Joined
- Jan 6, 2012
- Messages
- 563
- Office Version
- 365
- 2010
- Platform
- Windows
On my user-form, I have three checkboxes and public string variable called Description. For test purposes, I am using a message box to display the outcome. What I am wanting to do, if the user selects a checkbox it displays the caption of the checkbox in the message box. As another checkbox gets checked, it adds it to the variable. If the user deselects a checkbox, how can I remove it from the variable string? If there are any questions, comments, or concerns, please let me know. Thank you.
VBA Code:
Private Sub chkbxCIMN_Click()
If chkbxCIMN.Value = True Then
Description = Description & UCase(chkbxCIMN.Caption) & ", "
MsgBox Description
Else
If Description = UCase(chkbxCIMN.Caption) Then
Description = Description & ""
MsgBox Description
End If
End If
End Sub
VBA Code:
Private Sub chkbxKP_Click()
If chkbxKP.Value = True Then
Description = Description & UCase(chkbxKP.Caption) & ", "
MsgBox Description
Else
MsgBox Description
End If
End Sub
VBA Code:
Private Sub chkbxTroubleshoot_Click()
If chkbxTroubleshoot.Value = True Then
Description = Description & UCase(chkbxTroubleshoot.Caption) & ", "
MsgBox Description
Else
MsgBox Description
End If
End Sub