Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Rena Jones   on Dec 05 In MS Office Category.

  
Question Answered By: Jennifer Davis   on Dec 05

Where is the cursor when you press F5?

For instance, my little test in Module1 - two subroutines "a" and "b", both with
just message boxes ... put cursor somewhere inside Sub A, press F5, message box
A; put cursor somewhere inside Sub B, press F5, message box B.

A quote from a Web page: "You can run the macros either from the Visual Basic
Editor by placing your cursor in the macro and pressing the F5 key, or from
Excel by opening the Macros dialog box (ALT+F8) choosing the macro to run and
clicking Run. It is best to run these macros from Excel so you can watch them as
they work." This is good advice.

Should Excel care about the other modules? Remember that the VBA environment is
a project environment, and all of your modules  will be part of the same project
- so Excel is interested in them all. If you want to run just one subroutine
from the project, you are making Excel depart from its "normal" mode of
operation somewhat. So you need to tell it specifically what you want it to
run.

Share: 

 
 
Didn't find what you were looking for? Find more on Executing a specific module Or get search suggestion and latest updates.


Tagged: