coding conventions and project

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

TrustPilot

starstarstarstarstar Excellent

  • Home
  • Courses
  • Promotions
  • Schedule
  • Formats
  • Our Clients

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

resolvedResolved · High Priority · Version 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:

How to Remove Duplication's from a selection of data in an Excel 2010 Worksheet

It 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:-

1) Select the data that might contain duplication's
2) Click the ''Data'' tab
3) Go to ''Data Tools'' and click ''Remove Duplicates''
4) A box will appear. Tick the boxes of the columns that you want to use to check for duplicates. Finally, click ''OK.''

View all Excel hints and tips


Server loaded in 0.07 secs.