Macro Command to Select Records in an Excel Database

Last reviewed: November 30, 1994
Article ID: Q70791
The information in this article applies to:
  • Microsoft Excel for Windows, versions 2.x, 3.0, 4.0, 5.0
  • Microsoft Excel for OS/2, versions 2.2, 3.0
  • Microsoft Excel for the Macintosh, versions 1.x, 2.x, 3.0, 4.0, 5.0

SUMMARY

It is often necessary to select all the records in a database. If you select the area with the defined name, DATABASE, all the records plus the field names will be selected.

The following macro command will offset from the name of DATABASE to select just the records:

   =SELECT(OFFSET(!database,1,0,ROWS(!database)-1,COLUMNS(!database)))

REFERENCES

"Online Help," version 5.0 "Function Reference," version 4.0, pages 299-300, 387-379 "Function Reference," version 3.0, pages 163-164, 209-210 "Functions and Macros," version 2.1x, pages 320, 348


KBCategory: kbprg kbmacro
KBSubcategory:

Additional reference words: 1.0 1.00 1.03 1.04 1.06 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 5.0 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: November 30, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.