Find missing checkboxes in userform

Deepk

Board Regular
Joined
Mar 21, 2018
Messages
100
hi all,

The following code showing my userform contains approx. 170 checkboxes.

VBA Code:
Sub macro1()
Dim ctl As Control
Dim j As Long
'Dim msg As String
j = 3
For Each ctl In UserForm1.Controls
If TypeOf ctl Is MSForms.CheckBox Then
If UserForm1.Controls(ctl.Name).Value = False Then
Cells(j, 5).Value = ctl.Name
j = j + 1
End If
End If
Next
End Sub

However I am not able to identify checkboxes from CheckBox136 to CheckBox152. I took the help of properties window and explored all control but still not able to identify. Please help. Thank you in advance.
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

rlv01

Well-known Member
Joined
May 16, 2017
Messages
879
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Try modifying your code so that it displays more data about the checkboxes:
VBA Code:
Sub macro1()
    Dim ctl As Control
    Dim j As Long
    'Dim msg As String
    j = 3

    Cells(j, 5).Value = UserForm1.Name
    Cells(j, 6).Value = UserForm1.Height
    Cells(j, 7).Value = UserForm1.Width
    Cells(j, 8).Value = UserForm1.Top
    Cells(j, 9).Value = UserForm1.Left
    j = j + 1

    For Each ctl In UserForm1.Controls
        If TypeOf ctl Is MSForms.CheckBox Then
            If UserForm1.Controls(ctl.Name).Value = False Then
                Cells(j, 5).Value = ctl.Name
                Cells(j, 6).Value = ctl.Height
                Cells(j, 7).Value = ctl.Width
                Cells(j, 8).Value = ctl.Top
                Cells(j, 9).Value = ctl.Left
                Cells(j, 10).Value = ctl.Visible
                j = j + 1
            End If
        End If
    Next
End Sub

Then look for problems with the size, position, or visible properties:

1590168236320.png
 

Forum statistics

Threads
1,136,322
Messages
5,675,083
Members
419,549
Latest member
EliteBeat

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
Top