How to find the location of "Check Box 2110" in my workbook?

jplank

Board Regular
Joined
Sep 19, 2012
Messages
62
I have inherited a complex financial model. The model contains 50+ sheets, several of which are hidden by default. There is a line in the vba code:

VBA Code:
[Check Box 2110].value = True

My question is - how can I (using vba or otherwise) find the location of Check Box 2110. Sorry if this is a really simple question, but I've genuinely been spending hours on this. Google has shown me results related to adding a checkbox to a workbook or using vba to toggle whether it's checked or not, but I haven't had any luck finding techniques to actually find the checkbox.

Any help is appreciated. Thank you.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
I have inherited a complex financial model. The model contains 50+ sheets, several of which are hidden by default. There is a line in the vba code:

VBA Code:
[Check Box 2110].value = True

My question is - how can I (using vba or otherwise) find the location of Check Box 2110. Sorry if this is a really simple question, but I've genuinely been spending hours on this. Google has shown me results related to adding a checkbox to a workbook or using vba to toggle whether it's checked or not, but I haven't had any luck finding techniques to actually find the checkbox.

Any help is appreciated. Thank you.
i create code to loop through each sheet and find check box 2110 then select it and print its worksheet name and top left cell location
VBA Code:
Sub test() 'if your check box is oleobject
    Dim ws As Worksheet
    Dim oleObj As OLEObject
    For Each ws In ActiveWorkbook.Sheets
        For Each oleObj In ws.OLEObjects
            If oleObj.Name = "Check Box 2110" Then
                With oleObj
                    .Visible = True
                    .Select
                    Debug.Print .Parent.Name
                    Debug.Print .TopLeftCell.Address
                End With
            End If
        Next oleObj
    Next ws
End Sub

Sub test2() 'if your checkbox is forms control
    Dim ws As Worksheet
    Dim cb As CheckBox
    For Each ws In ActiveWorkbook.Sheets
        For Each cb In ws.CheckBoxes
            If cb.Name = "Check Box 2110" Then
                With cb
                    .Visible = True
                    .Select
                    Debug.Print .Parent.Name
                    Debug.Print .TopLeftCell.Address
                End With
            End If
        Next cb
    Next ws
End Sub
 
Upvote 1

Forum statistics

Threads
1,215,108
Messages
6,123,128
Members
449,097
Latest member
mlckr

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