Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've noticed in VBE that there are a number of locations where macros may be
created and executed: 1. Each sheet can contain macros 2. There is something called ThisWorkbook 3. There can be a number of modules Does it make any difference where I put my code? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Absolutely, it does. You also left out Userforms, and class modules.
Most macros are written in modules. Event-driven macros (like selecting a cell, or closing a workbook) are written either in the sheet or workbook, depending on the event. Workbooks have their specific set of events which are separate events from the workbook (thisworkbook) events. If you place your macros in a place they don't belong, they either won't run, or will produce unexpected results. "George B" wrote in message ... I've noticed in VBE that there are a number of locations where macros may be created and executed: 1. Each sheet can contain macros 2. There is something called ThisWorkbook 3. There can be a number of modules Does it make any difference where I put my code? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
See Chip Pearson's discussion:
http://www.cpearson.com/excel/codemods.htm Regards, Greg -----Original Message----- I've noticed in VBE that there are a number of locations where macros may be created and executed: 1. Each sheet can contain macros 2. There is something called ThisWorkbook 3. There can be a number of modules Does it make any difference where I put my code? . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks -- that reference was a big help.
George Borrmann "Greg Wilson" wrote in message ... See Chip Pearson's discussion: http://www.cpearson.com/excel/codemods.htm Regards, Greg -----Original Message----- I've noticed in VBE that there are a number of locations where macros may be created and executed: 1. Each sheet can contain macros 2. There is something called ThisWorkbook 3. There can be a number of modules Does it make any difference where I put my code? . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
where exactly is solver located at? | Excel Discussion (Misc queries) | |||
owners tab located? | Excel Discussion (Misc queries) | |||
where is the excel template located? | Excel Discussion (Misc queries) | |||
How to print the column # where the max row value is located? | Excel Worksheet Functions | |||
where can footnote be located? | Excel Discussion (Misc queries) |