The Generator places all generated statements in a subroutine. You can specify a new subroutine whenever desired. When you do, the Generator closes the current subroutine and starts a new one. Variables needed in every subroutine are also added:
...
End Sub
Sub NewRoutine()
Dim iCtrl As Integer ' Control index variable
Dim bOK As Boolean ' Return code variable
...
All session actions after this point are placed in the new subroutine. All actions performed before you have defined a subroutine go in a default subroutine started at the beginning of your session.
Use the Controls window to specify the new subroutine: