The following example uses the ProcCountLines property to return the number of lines of code in the specified procedure, SetupTabs, in a particular code pane.
Debug.Print Application.VBE.CodePanes(3).CodeModule.ProcCountLines ("SetupTabs", vbext_pk_Proc)