VBA UserForm with Check Box

jscranton

Well-known Member
Joined
May 30, 2011
Messages
707
I am trying to create a pretty simple UserForm that will contain 4-10 choices that I want end users to select all that apply and then create a text string based on their input. I have browsed the web but nothing seems really clear to me.

Can anyone point me towards resources/step-by-step instructions?

If it matters, this form is going to be displayed by a larger module that will need input from an end user at times. It will not appear on the source excel.

Also, one question I am anticipating is how to display the userform but still allow the source file to be viewed/navigated. In other words, I want to activate the userform but leave the source workbook active as well.

Thanks,

Justin
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Lets talk about this first:
I am trying to create a pretty simple UserForm that will contain 4-10 choices that I want end users to select all that apply and then create a text string based on their input.

So the user will select these choices where?

Do you mean if they select these choices from a Checkbox Caption?
If not explain more.

And you can open a UserForm and still work on your sheet by opening the Userform like this:

UserForm1.Show Modeless
 
Last edited:
Upvote 0
My hope is to display a userform with 4-10 check boxes. FWIW, users are reviewing the source workbook and determining if certain data types are present. If they are, I want to them to check the user form check box. I then want to write the check box name ("DOB", "Address", etc) to a string object and store it in an array. Does that answer your question?

THanks for the help.

Justin

PS

Weird to me that I am a "Board Regular" with <700 posts and you are the same with >15,000.
 
Upvote 0
A UserForm Checkbox only has a true or false value.
If the checkbox is checked it returns a value of true
If not checked it returns a value of False.

Now a Checkbox does have a name such as CheckBox1 and you can rename it.

So your saying your checkboxes will have names Like:

George
5447 Elm street
Gary Indiana
36879

And so if all three are checked you want to create a string like this:

George 5447 Elm street Gary Indiana 36879

Is that what you want?
<strike></strike>
 
Last edited:
Upvote 0
So the script needs to look at all CheckBoxes on the Userform.

And if they are checked then add the name of the checkbox to the string?

If that true?
 
Upvote 0
After looking at this:

1. A checkbox cannot be named 5644 Elm Street
CheckBoxes can only be given charter names like Alpha Bravo Charlie
So we would have to use the caption value.

And I would have to loop through all the checkboxes and exactly what way the loop runs is difficult for me to know.

This is beyond my knowledgebase.
I will continue to monitor this thread to see what I can learn.
 
Upvote 0
After looking at this:

1. A checkbox cannot be named 5644 Elm Street
CheckBoxes can only be given charter names like Alpha Bravo Charlie
So we would have to use the caption value.

And I would have to loop through all the checkboxes and exactly what way the loop runs is difficult for me to know.

This is beyond my knowledgebase.
I will continue to monitor this thread to see what I can learn.

I do I create a UserForm with two custom checkboxed named "Address" and "DOB"? Start there and we will figure this out.
 
Upvote 0
Rather than a bunch of checkboxes, you could use a multiselect ListBox with the .ListStyle set to fmListStyleOption.
Then you could loop through the list box enteries and see what the user checked.
 
Upvote 0

Forum statistics

Threads
1,223,714
Messages
6,174,052
Members
452,542
Latest member
Bricklin

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