After having written thousands of lines of codes over multiple sheets or modules, it is already hard enough to remember which sub-procedure does what. On top of that, what if you want to use a particular sub-procedure but you don’t remember where it is defined? Surprisingly, you DO NOT have to Ctrl+F it in every sheet or module. Yes, there is a short cut!
Jordan Goldmeier (aka Option Explicit) is here with his extensive VBA knowledge to help you out. The following explanation uses a small example to illustrate the power of this tip.
Jordan chose to define a Sub called ‘HereIam’ in Module 1 as can be seen from the picture.
Now, let’s say you are in Sheet 1 writing up a Sub that does something. You suddenly remember that you might be able to use the sub-procedure ‘HereIam’ to ease your work. But what ‘HereIam’ does is all vague in your head. So, you decide to look its definition up.
Just write “HereIam” anywhere in your program. The result should look like something in this image.
Right-click on HereIam and left-click on “Definition”.
And done! You must have been taken back to Module 1 where HereIam was defined. No need to waste unnecessary time using Ctrl+F repeatedly.
Use this whenever you are working through a large VBA program.
And, most importantly, do not forget to SHARE it!!
Have a good day.
Please log in again. The login page will open in a new window. After logging in you can close it and return to this page.