Problem with checkboxes in a userform...HELP!!:)

wassita

New Member
Joined
Mar 13, 2011
Messages
13
Hi all!<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
I have 14 checkboxes in a userform and I need a VBA code to verify all of them and do something. <o:p></o:p>
The code I need may have the structure below. Of course it doesn’t work.
I will post it just for you to see know what I have in mind. I named my checkboxes CB1, CB2, CB3,…,CB14.<o:p></o:p>
I would appreciate any help I could get. <o:p></o:p>
Rich (BB code):
Redim array1(1 to 14)<o:p></o:p>
For j = 1 To 14<o:p></o:p>
if UserForm2.CB & j = True Then <o:p></o:p>
array1(j) = True<o:p></o:p>
select case array(j)=true<o:p></o:p>
case array1(1)<o:p></o:p>
.<o:p></o:p>
.case array(2)<o:p></o:p>
.<o:p></o:p>
<o:p>.</o:p>
Case array1(14)<o:p></o:p>
End select<o:p></o:p>
End if<o:p></o:p>
<o:p></o:p>Next j<o:p></o:p>
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,224,548
Messages
6,179,448
Members
452,915
Latest member
hannnahheileen

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