Hi. I'm basically teaching myself some VBA skills when I need them. So please, bear with me.
I've created a user form for an Excel spreadsheet for fairly inexperienced users. I have combo boxes and text boxes that work perfectly well. However, I'm trying to add a check box and I guess I'm not quite sure how they work. Is the checkbox more an individual thing? Does it work in such a way that each item I want needs its own checkbox?
My user form might look something like this:
Patient Name: (text box)
Diagnosis: (combo box - list of 10)
CoMorbidities: (checkbox - list of 9 things, more than one can be chosen)
Basically, I was wondering if it would be possible to have a checkbox like this on a user form. Can I create something where you can select more than one option and then have it drop into my spreadsheet? I keep looking for this, but I'm not even aware if it's possible.
Another question I have is that if my a user closes the form without clicking on the "enter data" or "close form" command buttons, a "compile error" occurs. Here's the code that I have (from an example I found):
Private Sub UserForm_Click()
(Cancel As Integer, _
CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
Cancel = True
MsgBox "Please use the button!"
End If
The part in parenthesis turns red after the error.
Your patience and any help is appreciated. I hope I've provided enough information.
Thank you in advance.
Marianne
Bookmarks