How F12 Allows You to Move to a Variable or Subroutine
VBA programmers will know that you can press SHIFT + F2 on any variable or subroutine call, and the VBA code editor will immediately move your cursor position to the place where the variable or subroutine is declared. You can achieve the same effect in Visual Studio by pressing the F12 key.
For example, suppose that you have your cursor positioned in the word FirstName below:
FirstName = "Wise"
If you then press the F12 key, Visual Studio will automatically take you to the declaration of the FirstName variable or property. This technique works for variables, subroutine calls, methods, properties and events.
How to Get Back!
The problem is, how do you easily get back to where you were? The answer in VBA is to press SHIFT + CTRL + F2; the answer in Visual Studio is to customize your keyboard so that SHIFT + F12 will work. To do this, follow these instructions!
1) From the menu, select Tools / Options …
2) Select the Environment tab on the left, and within that the Keyboard tab.
3) Find the View.NavigateBackward command on the right-hand side of the dialog box (an easy way to do this is to type in part of the command in the search box).
4) Where the dialog box says Type shortcut keys , click in this box and press SHIFT + F12, then click on the Assign button to the right.
When you select OK, you'll be able to move forward and backward through your code. The back key also has a long memory, so pressing SHIFT + F12 repeatedly will take you down memory lane to all of the places you have been to in your code in the current session.