Document conventions (VBA)
Typographic conventions
Visual Basic documentation uses the following typographic conventions.
Convention | Description |
---|---|
Sub, If, ChDir, Print, True, Debug | Words in bold with initial letter capitalized indicate language-specific keywords. |
Setup | Words you are instructed to type appear in bold. |
object, varname, arglist | Italic, lowercase letters indicate placeholders for information you supply. |
pathname, filenumber | Bold, italic, and lowercase letters indicate placeholders for arguments where you can use either positional or named-argument syntax. |
[ expressionlist ] | In syntax, items inside brackets are optional. |
{While | Until} |
In syntax, braces and a vertical bar indicate a mandatory choice between two or more items. You must choose one of the items unless all of the items are also enclosed in brackets. For example: [{This | That}] |
ESC, ENTER | Words in capital letters indicate key names and key sequences. |
ALT+F1, CTRL+R | A plus sign (+) between key names indicates a combination of keys. For example, ALT+F1 means hold down the ALT key while pressing the F1 key. |
Code conventions
The following code conventions are used.
This font is used for code, variables, and error message text.
Sub HelloButton_Click()
Readout.Text = _
"Hello, world!"
End Sub
An apostrophe (') introduces code comments.
' This is a comment; these two lines
' are ignored when the program is running.
Lines too long to fit on one line (except comments) may be continued on the next line by using a line-continuation character, which is a single leading space followed by an underscore ( _):
Sub Form_MouseDown (Button As Integer, _
Shift As Integer, X As Single, Y As Single)
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기