Hello everyone
I have a worksheet with values in column D from D2 to the last row. I need to create userform on the fly with checkboxes for the user with each unique value and beside each checkbox a label for each checkbox and at the bottom command button that has a macro to execute say MsgBox "Hello",64
Create dynamic userform with unique value as checkboxes
-
- PlatinumLounger
- Posts: 4931
- Joined: 31 Aug 2016, 09:02
-
- Administrator
- Posts: 78545
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Create dynamic userform with unique value as checkboxes
What is the maximum number of rows you expect?
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4931
- Joined: 31 Aug 2016, 09:02
Re: Create dynamic userform with unique value as checkboxes
About 10,000 rows. But the unique values will be maximum 12 values (or even 6 values)
-
- 5StarLounger
- Posts: 817
- Joined: 24 Jan 2010, 15:56
Re: Create dynamic userform with unique value as checkboxes
You could simply use a listbox with its ListStyle set to fmListStyleOption.
Regards,
Rory
Rory
-
- PlatinumLounger
- Posts: 4931
- Joined: 31 Aug 2016, 09:02
Re: Create dynamic userform with unique value as checkboxes
But I need checkboxes as the user may select more than one option.
-
- 5StarLounger
- Posts: 817
- Joined: 24 Jan 2010, 15:56
Re: Create dynamic userform with unique value as checkboxes
Try it. Forgot to mention that you will of course want to make the listbox multiselect!
Regards,
Rory
Rory
-
- Administrator
- Posts: 78545
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Create dynamic userform with unique value as checkboxes
The userform listbox control has a MultiSelect property. You can set it to 1 - fmMultiSelectMulti or to 2 - fmMultiSelectExtended.
Best wishes,
Hans
Hans