Formerly Best Training
© 2024 STL. All Rights Reserved.
All prices offered for business users and exclude VAT. E&OE
2nd Floor, CA House, 1 Northey Street, Limehouse Basin, London, E14 8BT. United Kingdom
Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Coding conventions and project structure conventions
Resolved · High Priority · Version 2003
Claudia has attended:
Excel VBA Intro Intermediate course
Excel VBA Intro Intermediate course
When writing code, the best conventions for storing private and public variables, make it easier to call procedures. When passing codes to colleagues, everyone will understand the conventions.
Hi Claudia
Thank you for your question
Writing code so that it is easily understood is a common challenge, and the following guidelines will help.
1. Always use naming conventions when declaring variables. For instance an integer variable might be prefixed with "int" a string "str" and son on. This makes it easier to understand what is happening to the code as it runs.
2. Give procedures meaningful names, so that it is clear what actions they are carrying out.
3. Always indent your code properly. Every line of code should be indented once within the procedure, and then always indent code within a loop, decision structure or with block. This allows the structure of your code to be more apparent.
4. Finally, use remarks liberally.Every major line of code should have explanatory remarks associated with it. When in doubt, annotate it.
Hope this helps
Regards
Stephen
Tue 19 May 2009: Automatically marked as resolved.
|
Excel tip:How to Remove Duplication's from a selection of data in an Excel 2010 WorksheetIt would take far too much time to scan through rows and rows of data to find and remove duplicate data. So, here's how to do this using a much more efficient method:- |
We'll call during UK business hours
Server loaded in 0.07 secs.