Get.Cell with Type_num 24 Returns Color of Font Not Number

Last reviewed: November 1, 1994
Article ID: Q68019

SUMMARY

Using the Get.Cell macro function with a type number of 24 returns the color of the font used, not the color described under the Format Number command.

MORE INFORMATION

The Get.Cell function along with a type number of 24 returns a number from 0-16, which corresponds to the color selected under the Font command of the Format menu. The number 0 corresponds to Automatic, and the numbers 1-16 correspond to the 16 color positions in the color Palette.

If the number -23 was formatted with a blue font and a number format was also used that made negative numbers red, the number would display red because any number format will override a format font color setting. In the case above, one might expect the Get.Cell function with a type_num of 24 to return the number 3, which corresponds to red. However, the function actually returns a value of 5, which corresponds to the color blue because that is the font color selected.

Currently, the only way to get the number format color used is to use the Get.Cell function with a type_num of 7, then extract the color using the RIGHT, LEFT, and LEN functions.

REFERENCES

For more information on the Get.Cell function, refer to pages 103-105 of the "Microsoft Excel Function Reference."

For more information on the LEFT, RIGHT, and LEN functions, refer to pages 137-138 and 200 of this reference manual.


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