How can I jump to a particular procedure or function in the Visual Basic Editor?

JeffreyWeir

Super Moderator
Staff member
Joined
Mar 22, 2011
Messages
357
Reaction score
0
Points
0
Location
New Zealand
Say I see this in the middle of a very busy VBA project:
SomeProcedure "Variable1"

Is there a shortcut that will let me jump to SomeProcedure to check it out?

Anyone got any other great VBE shortcut tips they'd like to share, while we're on the subject of productivity? I found some at http://datapigtechnologies.com/blog/index.php/vbe-tips-i-wish-i-knew-5-years-ago/ but I'm interested in MORE MORE MORE!!!!
 
Select SomeProcedure then hit Shift-F2.
 
And Ctrl-Shift-F2 takes you back.
 
If you type in part of a variable/function name, hitting the spacebar will complete it for you, or give you intellisense.
 
If you select a code module in the VBIDE and double-click, it brings up the code pane. If you do this with a userform, it brings up the form designer. To see the form code, you would normally select the form, right-click, and View Code, but you can select it and hit F7 to see the code.
 
Nice Bob! I knew the Intellisense, but obviously need to learn a few more keyboard shortcuts in the VBIDE.
 
Jeffrey, not a shortcut, but in code I find Debug.Assert amazingly useful. It is back-to-front in my view, you use

Code:
Debug.Assert somevalue <> 17

to break when somevalue DOES equal 17, but very handy nonetheless.
 
Hi all...

I am using for years now the VBE Tools http://www.oaltd.co.uk/VBETools/Default.htm and I find them very cool; especially the feature for renaming controls on a userform and also in the code module. There are also some more good tools with more features here http://www.mztools.com, but personally they are a little bit oversized for me.

Best regards :)
 
Something I recall telling at our UK Excel conference 2 years ago, and found even the other presenters did not know - you can drag-and-drop any object into the watch-window, much simpler than menus (I always use the Watch window, not the Locals window, it is more targetted).
 
I use both windows, depending on the task, but they're always open. I use F7 a lot (& Shift + F7), along with F4, Ctrl + G and Ctrl + R (if either aren't open already). Some handy one's I like a lot, but generally don't get as much attention are Ctrl + I, Ctrl + Shift + I, mouse hover, Ctrl + mouse hover, and my newest favorite, Ctrl + F8. And if there are a lot of breakpoints, I use Ctrl + Shift + F9 to clear them easily.
 
Back
Top