Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

STL - Formerly Best Training Solutions Through Learning
TrustPilot
Excellent
Request Callback We will call you back
0207 987 3777 Call for assistance
Your Basket Basket is empty
coding conventions and project

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Coding conventions and project structure conventions

Coding conventions and project structure conventions

ResolvedVersion 2003

Claudia has attended:
Excel VBA Intro Intermediate course
Excel VBA Intro Intermediate course

Coding conventions and project structure conventions

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.

RE: Coding conventions and project structure 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:

Use Paint Brush to Format More than one Cell

To copy a format to many cells or ranges

1. Select the cell with the format that you want to copy

2. Double-click on the paint brush

When you move to the cell where you want to paste the format you will notice that a paint brush follows the cursor.

Paste the format to all the cells or ranges you need to format.

When finished go back to the paint brush on the tool bar and single click on it to deactivate the function.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.