The following example uses the ProcOfLine property to return the name of the procedure containing the specified line number in a particular code pane.
Debug.Print Application.VBE.CodePanes(3).CodeModule.ProcOfLine (1270, vbext_pk_Proc)