search project

methody

Well-known Member
Joined
Jun 17, 2002
Messages
857
Hello there
I have large and fairly complicated workbook with many worksheets, modules, macros, and userforms.
Previoulsy I have gone to great lengths to protect the workbook by using protect and unprotect commands at various places. Now I need to remove all these commands which are found thoroughout the project.
I have done it as thoroughly as possible manually but I know there are still some there. Is there any way of searching for these commands within the project or code that would fine them.
thanks
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
thanks for that.
In principle that would be helpful. I have tried to follow the instructions including the bit at the top but I can't get it to work. eg where do I put the searchmodule code
 
Upvote 0
The code goes into a regular module. You would need to change the parts in red

Rich (BB code):
        Set VBProj = ActiveWorkbook.VBProject
        Set VBComp = VBProj.VBComponents("Module1")
        Set CodeMod = VBComp.CodeModule
        
        FindWhat = "findthis"

and you might want to change

Rich (BB code):
Debug.Print "Found at: Line: " & CStr(SL) & " Column: " & CStr(SC)

to write to a sheet.
 
Upvote 0

Forum statistics

Threads
1,224,507
Messages
6,179,181
Members
452,893
Latest member
denay

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