COUNTING MACROS AND CHECKING ON WHICH ONES ARE BEING USED

Mr_Phil

Board Regular
Joined
May 28, 2018
Messages
141
Office Version
  1. 365
Here's a tough one. I have an ancient workbook that easily started life as an Excel 97 or 07. It has a (precision count) bazillion macros. There are so many that I would love a way to list them and then list the last use of them. Then, as I update the workbook I could remove the no longer useful macros. I have no clue how to even approach this. Any ideas?
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
There is some code here that will create a list of all your macros in a workbook. See here: Generating a List of Macros (Microsoft Excel)

As for when they were last used, I don't think there is any way to do that, as I don't believe it is anything that Excel tracks.
The only possible way I could think of doing that is creating a log file (or sheet in your current workbook), and add code to EVERY macro that logs to this location every time it is run.
That would obviously be a lot of work, as you would have to update EVERY macro, and it would only work from that point forward.
 
Upvote 0
Solution
There is some code here that will create a list of all your macros in a workbook. See here: Generating a List of Macros (Microsoft Excel)

As for when they were last used, I don't think there is any way to do that, as I don't believe it is anything that Excel tracks.
The only possible way I could think of doing that is creating a log file (or sheet in your current workbook), and add code to EVERY macro that logs to this location every time it is run.
That would obviously be a lot of work, as you would have to update EVERY macro, and it would only work from that point forward.

Way cool :cool: I like the idea of the list and I like the log sheet idea. I think I will copy the workbook and implement both ideas. I'm wondering if I do a control H and replace every instance of "end sub" with "something, control J, end sub" or something like it if that would work. I apologize for the delay between your answer and my response. I had to travel and things got a bit hairy for a short time. Thank you very much for the help.
 
Upvote 0
You are welcome.
Glad I was able to help!
 
Upvote 0

Forum statistics

Threads
1,214,952
Messages
6,122,458
Members
449,085
Latest member
ExcelError

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