Click here to Skip to main content
15,888,007 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am working with a huge excel workbook.

The issue is that I had to add a new line and all the macros are not wiriting to the correct cell.

I want to know a way to see all the macros that a single sheet(not workbook) is calling.

What I have tried:

I have clicked on developer-> macros but they dont tell me which sheet reference it.

I want some thing like visual studio find all references thing.
Posted
Updated 3-Mar-16 6:16am
Comments
ZurdoDev 3-Mar-16 11:25am    
I don't think that is possible. There is no way for Excel to know for sure if a sheet will be touched by a macro or not. For example, you can use ActiveSheet so it will depend on which sheet is active.
Vasily Tserekh 3-Mar-16 11:34am    
I can click on a radio button on a sheet and select assign macro and it will get me to the macro that have been already assigned. I want to know if there is a way of listing all the controls in the sheet that have macros assigned. Not programmatically but using office UI.
Patrice T 3-Mar-16 12:26pm    
I think it is not possible to list all macro used in a Sheet.
RedDk 3-Mar-16 12:43pm    
Get 'yer hands on a classic:

Getz & Gilbert "VBA Developer's Handbook" (ISBN 0-7821-2978-1)

As I recall, and as I am too 'mired in work right now to seek on my disorganized harddrive, there's a whole chapter on VBA console automation from both Access and Excel.


1 solution

You can write some VBA to list all of the macros in your worksheet - see this link Generating a List of Macros (Microsoft Excel)[^]. As well as the reference given you will need to have a reference to "Microsoft Visual Basic For Applications Extensibility Library".

In theory you can do something similar to get the controls that have been used and match them up to the macro names - I did something similar years ago but it was in VB6 and I no longer have access to it.

This stuff on github might help though - Excel macro to export all VBA source code in this project to text files for proper source control versioning · GitHub[^]
 
Share this answer
 
Comments
Maciej Los 3-Mar-16 14:48pm    
5ed!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900