Find missing checkboxes in userform

Deepk

Board Regular
Joined
Mar 21, 2018
Messages
105
Office Version
  1. 2016
Platform
  1. Windows
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

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
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
 
Upvote 0

Forum statistics

Threads
1,215,615
Messages
6,125,857
Members
449,266
Latest member
davinroach

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