Table of contents
Collapse the table of content
Expand the table of content

Only comments may appear after End Sub, End Function, or End Property

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Only comments, directives, and declarations are permitted outsideprocedures. This error has the following cause and solution:

  • You placed executable code outside a procedure. Any nondeclarative lines outside a procedure must begin with a comment delimiter ( ' ). Declarative statements must appear before the first procedure declaration. Comments are ignored when the code executes.

For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).

© 2018 Microsoft