Get.Cell with Type_num 24 Returns Color of Font Not NumberLast reviewed: November 1, 1994Article ID: Q68019 |
SUMMARYUsing 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 INFORMATIONThe 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.
REFERENCESFor 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
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |