Code is stored in a module. →Insert→Module Start a SUB (subroutine) [type in a name] →Insert→Procedure →OK (the name must be a single word) Put all commands between: Sub and name()” “Public Sub” “End In general, have separate SUBS for separate tasks (a macro is a SUB). To run a SUB, press <F5>. To step through 1 line at a time, press <F8> Setup Variable Declaration →Tools→Options→Editor→Require Uncheck: Syntax Check →Tools→Options→Editor→Auto Typing Indent for readability (use the <Tab> key or To remove an indentation, use →Edit→Indent). <Shift><Tab> or →Edit→Outdent)
Code is stored in a module. →Insert→Module Start a SUB (subroutine) →Insert→Procedure [type in a name] →OK (the name must be a single word) Put all commands between: “Public Sub name()” and “End Sub” In general, have separate SUBS for separate tasks (a macro is a SUB). To run a SUB, press <F5>. To step through 1 line at a time, press <F8> Setup →Tools→Options→Editor→Require Variable Declaration Uncheck: →Tools→Options→Editor→Auto Syntax Check Typing Indent for readability (use the <Tab> key or →Edit→Indent). To remove an indentation, use <Shift><Tab> or →Edit→Outdent)
MgtOp-556-Topic-1-Set-1.docx