Excel: Selecting Active Portion of Spreadsheet Using a Macro

Last reviewed: November 29, 1994
Article ID: Q26886

SUMMARY

To select the entire active portion of a Microsoft Excel worksheet using a macro, do the following:

  1. Select the range from the first cell in the upper-left corner of the worksheet through the last active cell.

  2. Use the following commands in a command macro:

          =SELECT.LAST.CELL()
          =SELECT(ACTIVE.CELL():!A1)
    

For more information about the SELECT.LAST.CELL function, see page 382 in "Microsoft Excel Function Reference," version 4.0 manual. If you are using version 3.0, see page 213 in the "Microsoft Excel Function Reference" version 3.0 manual. If you are using Excel 2.20, see page 277 in the "Microsoft Excel Functions and Macros" version 2.2 manual.


KBCategory: kbusage
KBSubcategory:

Additional words: 1.0 1.00 1.03 1.04 1.06 1.5 1.50 2.2 2.20
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 29, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.