Hi all,
can anybody suggest that what is the difference between writing VBA code in worksheet code window and module code window.
suggestions will be appreciated.
Hi all,
can anybody suggest that what is the difference between writing VBA code in worksheet code window and module code window.
suggestions will be appreciated.
The worksheet code module is to hold code that would pertain directly to that sheet, usually triggered b y some worksheet event.
The standard code module is more generic, and can be used by procedures in This Workbook, a worksheet, a form, a class, or just other procedures in standard code modules.
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
There is a very big differenece, and that difference has to do with the scope of the code.
Code behind a worksheet is only available for use by that worksheet, but code placed into a module can be called from any worksheet.
-Randy Shea
I'm a programmer, but I'm also pro-grammar!
If your issue is resolved, please use Thread Tools to mark your thread as Solved!
PODA (Professional Office Developers Association) | Certifiable | MOS: Access 2003
Threads merged, anandbw82 please only post one thread per question.
Regards,
Simon
Please read this before cross posting!
In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
If I have seen further it is by standing on the shoulders of giants.
Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)
Not absolutely correct, you can access a procedure in a worksheet code module if it is public in scope byh preceding with the worksheet codename.Originally Posted by CreganTur
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber