The following example uses the Lines property to return a specific block of code, lines 1 through 4, in a particular code pane.
Debug.Print Application.VBE.CodePanes(1).CodeModule.Lines( 1, 4)