VBA命名规范
| Element | Naming Convention |
|---|---|
| <scope><array><data type>DescriptiveName | |
| <scope><data type>DESCRIPTIVE_NAME | |
Type DESCRIPTIVE_NAME | |
Enum <project prefix>GeneralDescr |
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>)
| Prefix | Data Type | Prefix | Data Type | Prefix | Data Type |
|---|---|---|---|---|---|
| b | Boolean | cm | ADODB.Command | cbo | MSForms.ComboBox |
| byt | Byte | cn | ADODB.Connection | chk | MSForms.CheckBox |
| cur | Currency | rs | ADODB.Recordset | cmd | MSForms.CommandButton |
| dte | Date | ddn | MSForms.ComboBox | ||
| dec | Decimal | cht | Excel.Chart | fra | MSForms.Frame |
| d | Double | rng | Excel.Range | lbl | MSForms.Label |
| i | Integer | wkb | Excel.Workbook | lst | MSForms.ListBox |
| l | Long | wks | Excel.Worksheet | mpg | MSForms.MultiPage |
| obj | Object | opt | MSForms.OptionButton | ||
| sng | Single | cbr | Office.CommandBar | spn | MSForms.SpinButton |
| s | String | ctl | Office.CommandBarControl | txt | MSForms.TextBox |
| u | User-defined type | ||||
| v | Variant | cls | User-defined class variable | ref | RefEdit Control |
| frm | Userform variable | col | VBA.Collection |
Powered by ScribeFire.
浙公网安备 33010602011771号