View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
StumpedAgain StumpedAgain is offline
external usenet poster
 
Posts: 192
Default View Code question

So code in the View Code window IS a macro but just doesn't reside in a
module?

Yes, the code that you see in the View Code window is a macro that is
usually specific to that worksheet.

And macros in worksheets and modules both reside in the workbook file?


Everything is stored in the same file. In the "Project Explorer"
(View-Project Explorer) you can browse code by workbook or by module.
--
-SA


"Doug Waters 03/03/08" wrote:

So code in the View Code window IS a macro but just doesn't reside in a
module? And macros in worksheets and modules both reside in the workbook
file?

"Tim879" wrote:

typically you would put event procedures in the worksheet level and
"macros" in the modules.

the difference is the code placed in these sheets is usually for
worksheet level events (i.e. when a cell is changed, selected, etc.)
vs. code placed in modules which could be for anything.

For example, if you wanted to trigger a macro when a user entered a
value in a given cell, you would put the code to trigger the macro in
the worksheet.

this site has a great explanation of event procedures with some
examples.
http://www.cpearson.com/excel/Events.aspx




On Jul 17, 10:39 am, Doug Waters 03/03/08
wrote:
Please excuse an inexperienced but motivated newbie's question:

In Excel, when you right-click the tab for a given worksheet in a workbook,
and then select View Code from the resultant popup menu, what is the name of
the type of code that goes/resides in the Code window that then appears in
Visual Basic Editor (since it apparently is not a macro)? I need to know
what this type of code is called so I can research it when and how to use it.

Thanks for any help that anyone can provide.

Doug