Naming Conventions----Best pratice

Variables: <scope><array><data type>Descriptive_Name

Constants: <scope><data type>Descriptive_Name

User-defined types: Type Descriptive_Name

              <data type> Descriptive_Name

            End Type

Enumeration types: Enum <project profix>General Descr

              <project profix> GeneralDescrSpecificName1
              <project profix> GeneralDescrSpecificName2

           End Enum

=============================================================

The Scope Specifier (<scope>)
g—Public
m—Module-level
(nothing)—Procedure-level

The Array Specifier (<array>)
a—Array
(nothing)—Not an array

The Data Type Specifier (<data type>)

ex: i for integar, d for double...

Enumeration Types

ex: xlPaperA4 represents A4 paper

 

CodeName and TabName:
-------------------------------------------------------
Using CodeName instead of the TabName for worksheet.

Name Conventions prefix:
-------------------------------------------------------
worksheet:
  wks-->worksheet
chart:
  cht-->chart
shapes:
  pic-->Picture
  rec-->Rectangle
  txt-->TextBox (not the ActiveX control)
  cht-->ChartObject
  eqn-->Equation
  qry-->QueryTable
  pvt-->PivotTable
  art-->WordArt
Defined Names:
  cht-->Chart Data Range
  con-->Named Constant
  err-->Error Check
  for-->Named Formula
  inp-->Input Range
  out-->Output Range
  ptr-->Specific Cell Location
  rgn-->Region
  set-->UI Setting
  tbl-->Table

 

posted @ 2014-08-22 09:48  Roy Liao  阅读(232)  评论(0编辑  收藏  举报