help with an event driven sub argument please
Everything is an object : this mean the code is associated to the object
it is written in. A module is generic and may be used by other objects.
the "Sub Worksheet_Change" is a reserved name and mean you want the
macro to be auto-called when a special event (here any change in the
entry of a cell: only the entry, if an unchanged formula gives a new
result, this will not be a cell change).
So, since this macro must be lauched by the worksheet (as an object)
it must be associated to this worksheet.
So the worksheet launch the "Worksheet_Change" Zub (inside itself)
when a change occurs. But it will not launch anything else neither
elsewhere.
Each sheet may have its own event management
Then: now it's like any other sub: the name is reserved, and the sub is
called by an event, but the syntax stays as usual: so this mean the
caller (here the worksheet) will gives the input. Target is an input.
You can know which cells are the changed ones.
|