Macro to Activate the Maximum Value of a Column

Last reviewed: November 2, 1994
Article ID: Q65764

SUMMARY

The following macro will activate the cell with the maximum value in the column that contains the active cell on the active sheet:

          A

   1  Find_Max
   2 =FORMULA.FIND(MAX(TEXTREF(GET.DOCUMENT(1)&"!c")),2,1,2,1)
   3 =RETURN()

MAX(TEXTREF(GET.DOCUMENT(1)&"!c")) finds the maximum value in the column containing the active cell in the active document.

FORMULA.FIND(Max,2,1,2,1)

Max is the maximum value as found by MAX. ,2,1,2,1 tells FORMULA.FIND to look in values, at the whole value, in columns, and to find the next occurrence of Max.


KBCategory: kbother
KBSubcategory:

Additional reference words: noupd


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 2, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.