Excel Userform - Multiple Checkbox comments populate textbox upon clicking

jbeet

New Member
Joined
Feb 1, 2015
Messages
13
Hello! I have a userform with two sections. There are 4 checkboxes in each section with the idea that they will be pre-populated comments that will fill into a textbox. I am able to get it to populate text into the textbox when one box is checked however the way I have it written only allows for one comment to be populated at a time. I need to plan for a scenario where all 4 boxes plus some free hand comments could be added to the textbox. I am sure this can be done but I am struggling to find the answer.

Also - I have 2 sections and 2 textboxes. So the checkboxes need to populate the textbox that they are related to...

Here is what I have so far:

This is the code for one of the checkboxes (this works and is identical for each box but as stated, only allows one to be clicked)
[Private Sub CBParty_Click()
If Me.CBParty.Value = True Then
TXTPayment = "Payment sent to an incorrect party."
Else
TXTPayment = ""
End If
End Sub]

This is what I was trying to do to loop through but I know its not right..


[Private Sub CBChecker_()
Dim c As Control
For Each c In Me.Controls
If TypeName(c) = "CheckBox" Then
If c.Value = True Then
TXTPayment.Value
End If
End If

End Sub]

Thank you in advance for any help you can provide!
 
I am sorry for the slow response back - Yes - This looks like exactly what I was attempting to accomplish!! I am sorry I was not clear with my explanation. Thank you all for your help!
 
Upvote 0

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
I am sorry for the slow response back - Yes - This looks like exactly what I was attempting to accomplish!! I am sorry I was not clear with my explanation. Thank you all for your help!


I'm glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,792
Messages
6,121,612
Members
449,039
Latest member
Mbone Mathonsi

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