Auto code in VBE when pressing F7

B

Bishop

When I pull up a Form and press F7 to see the code VBE will automatically add:

Sub BlahBlah_Click ()

End Sub

to the bottom of my existing code. How do I make this stop?
 
B

Bishop

Hmm... not really what I was looking for. Pressing the F7 key allows me to
stay on the keyboard. And your method requires extra steps. I notice it
doesn't do this all the time. Surely there is a way to prevent it. Why else
would it do it on some forms and not others?
 
A

Andy Pope

Hi,

Once you have the code window open you could use CTRL+TAB to return to it.

F7 on a userform will take you to an event of the active control.

Cheers
Andy
 
B

Bishop

CTRL+Tab seems to have no discernable order. It takes me from the the code
for Form1 to Module3 to Module 7 to Form2 to code for Form3 so on and so
forth. How do I set the tab order?
 
B

Bishop

If you click on the Form name in the Project Window and hit F7 it will simply
show you the code. If you click on the actual Userform and hit F7 then it
will go to the code window and auto-populate a new procedure.
 
A

Andy Pope

The order is the same as the order of items under the Windows menu.

So if you want keystrokes only, ALT+W followed by the number of the window
to gain focus.

Cheers
Andy
 
P

Patrick Molloy

understood. i get around this by double clicking a button or whatever that
has code written.
I agree , its a pain :(
- nope, I can't see how to prevent it I'm afraid
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top