Microsoft KB Archive/52129

{|
 * width="100%"|

Excel: Finding Cell References in a Split or Frozen Pane

 * }

-

The information in this article applies to:


 * Microsoft Excel for Windows, versions 2.x, 3.0, 4.0
 * Microsoft Excel for the Macintosh, versions 1.5, 2.2, 3.0, 4.0
 * Microsoft Excel for OS/2, versions 2.2 and 3.0

-

SUMMARY
To obtain the row and column numbers of the cells in the panes of a Microsoft Excel document, use the GET.WINDOW command, as follows:

  GET.WINDOW(13) returns an array of the first column in each pane. GET.WINDOW(14) returns an array of the first row in each pane. GET.WINDOW(15) returns an array of the last column in each pane. GET.WINDOW(16) returns an array of the last row in each pane.

The INDEX command can then be used to return the value of the row and column from the desired pane. The panes are numbered starting with the upper right and proceeding counter-clockwise.

MORE INFORMATION
For example, to select the upper-left corner of the fourth pane (lower right) in the active window, use the following macro sequence:

  A1: =INDEX(GET.WINDOW(13),4) A2: =INDEX(GET.WINDOW(14),4) A3: =SELECT(&quot;R&quot;&amp;A1&amp;&quot;C&quot;&amp;A2) A4: =RETURN

Or, for greater efficiency, you could modify A3 to read:

      =SELECT(OFFSET(!A1,A1-1,A2-1))