XL5: Subroutine Can't Tell Which Sheet Tabs Are Visible

Last reviewed: September 12, 1996
Article ID: Q108643
The information in this article applies to:

- Microsoft Excel for Windows, version 5.0

SUMMARY

In Microsoft Excel version 5.0, it is not possible for a Microsoft Excel version 5.0 macro or a Visual Basic subroutine to determine which sheet tabs are visible at any given time.

MORE INFORMATION

It is not possible to determine which sheet tabs are visible because of the way in which sheets and sheet tabs interact with each other. It is not necessarily true that you can see the sheet tab for the active sheet, since you can use the tab scrolling buttons to scroll left and right without actually activating a sheet.

For example, if you have a workbook that contains 50 worksheets, named Sheet1, Sheet2, Sheet3, and so on, you can activate Sheet1 and then use the tab scrolling buttons to scroll all the way to Sheet50 without actually activating any other sheet.

To determine the name of the ACTIVE sheet, you can use the Visual Basic procedure

   ActiveSheet.Name

or the Microsoft Excel version 4.0 macro command:

   =RIGHT(GET.DOCUMENT(1),LEN(GET.DOCUMENT(1))-
    SEARCH("]",GET.DOCUMENT(1),1))

NOTE: The above command must be entered as a single line, with no spaces.


KBCategory: kbusage
KBSubcategory:

Additional reference words: 5.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: September 12, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.