search in code

NCL_Flyer

New Member
Joined
Jan 12, 2022
Messages
5
Office Version
  1. 2019
Platform
  1. Windows
Hi, my first post here.
I did write some seriously complex vba stuff years ago. There are about 50 forms, all with some kind of code and 5 modules with up to 50 scripts each.
Now I am faced with having to do some serious changes to my code, but my coding skills got a bit rusty.
I need to replace update sections of the code but first need to find all instances where a reference is made to a spreadsheet or a certain variable.
At the moment, I use ctrl+F, enter the search string and then press Next until I am through at least once, which is very time consuming...
=> Is there a way to FIND ALL instances of a string used in the CURRENT PROJECT?
Thanks, JR
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Try CTRL+ H to use the replace function. you can replace one at a time or replace all.
 
Upvote 0
I'm afraid that won't do. The code I need to review and potentially correct would be in the lines underneath.
Example code:
Call exist_data("FSE_2021.xlsm", "other items", "A:A", item_code, current_row, "yes")
If current_row = 0 Then Exit Sub
owner_id = Cells(current_row, "B").Value
start_date = Cells(current_row, "C").Value
end_date = Cells(current_row, "D").Value

The code has many references to cells on spreadsheets. I have to insert some columns which means I need to revisit all instances where the spreadsheet "other items" is found, then manually validate if there is a reference to a cell in column D (end_date) and change that to column F (just an example)

What I am looking for is a tool that provides me with a list of the instances where a match was found. Does that exist? Even as an external tool that I could link?
 
Upvote 0
I use an add-in called MZ-Tools, whilst you need to pay for the current version, there are still a number of sites that offer version 3.0 as a free download.
 
Upvote 0
Solution
Hi Fluff, never heard of them but that looks like a good solution. I will do a bit of reading and see if I can get a trial version.

Thanks for the suggestion.
 
Upvote 0

Forum statistics

Threads
1,213,501
Messages
6,114,010
Members
448,543
Latest member
MartinLarkin

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