The following example uses the CountOfVisibleLines property to return the number of lines visible at one time in a particular code pane, based on the height of the pane.
Debug.Print Application.VBE.Codepanes(3).CountOfVisibleLines