Excel: Finding Cell References in a Split or Frozen Pane

Last reviewed: November 30, 1994
Article ID: Q52129
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("R"&A1&"C"&A2)
   A4: =RETURN()

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

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

REFERENCES

"Microsoft Excel Function Reference," version 4.0, pages 207-212, 238, 389-390

"Microsoft Excel Function Reference," version 3.0, pages 115-116, 127-129

"Microsoft Excel Functions and Macros," version 2.2, pages 44-45, 239-240


KBCategory: kbother
KBSubcategory:

Additional reference words: 1.0 1.00 1.03 1.04 1.06 1.5 1.50 2.0
2.00 2.01 2.1 2.10 2.2 2.20 2.21 3.0 3.00 4.0 4.00


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 30, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.