New VBA user: Help with Checkboxes on Created User Form

MarianneR

New Member
Joined
Oct 13, 2005
Messages
7
Hi.

I'm fairly experienced with Excel and am teaching myself VBA skills as I need them. I'm working on creating a userform for fairly inexperienced users. So far, the majority of the data entry is either text boxes or pull downs (combo boxes). What I'm working on is a group of checkboxes.

Here's what my a couple data elements might look like:
Patient name (text box)
Diagnosis (combo box)

Then there would be a list of other diagnoses/complications:
Asthma (checkbox).
Cardiovascular Issues (checkbox). ETC

I figured out how to create and name the checkboxes. However, I cannot figure out the code to make the textboxes work where the responses dump into my datasheet. I'm sure part of it is that I'm not initializing the checkboxes.

I've been looking online for tutorials to work through, but none has seemed to work for me. I'm just not quite sure the proper steps are to 1) have the program recognize the check boxes and know what to do and 2) have the response be unloaded into my datasheet.

I would sincerely appreciate any help.
Thanks!
Marianne
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
A CheckBox's Value property is either True (checked) or False (not checked). If you want to populate a cell when the CheckBox is clicked, you can use its Click event procedure like this:

Code:
Private Sub CheckBox1_Click()
   If CheckBox1.Value = True Then
      Worksheets("Sheet1").Range("A1").Value = "Yes"
   Else
      Worksheets("Sheet1").Range("A1").Value = "No"
   End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,551
Members
449,088
Latest member
davidcom

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