• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Designers Corner

Writing programs in VBA is simpler than in many other programming languages, but VBA programmers should still use good programming practices. Following good programming conventions will help VBA programmers debug their code as well as make it easier to maintain. Here are a few rules of thumb to follow to make sure your code follows good programming practices.

One practice is to make sure that you understand the layout of your code. If your code is basically one big procedure or functions, examine it to see if you are repeating code in any areas. For example, does your code add apply the same effect in the same manner to a number of different elements. If so, you may want to move the code that does the effect out to a new function. This will accomplish two things. First, moving the repeated effect code out of the main procedure will make it easier to understand and maintain. Second, if you wish to change the way the effect is applied, having it centrally located in a separate procedure means it only needs to be changed one time.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint