ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Using Lookup Function based on Font Color (https://www.excelbanter.com/excel-worksheet-functions/180024-using-lookup-function-based-font-color.html)

jstec68

Using Lookup Function based on Font Color
 
Hello! I have several rows of data currently in which I would like to pull
data from. I could very easily use the LOOKUP function to do this. However,
both the lookup range and vector range are all numbers. I only want the
LOOKUP function to search for LOOKUP Values that are in a certain font color
(red). To my knowledge, the LOOKUP Value can only be a number, text, logical
value, or name or reference to a cell. Font Color is not one of my options.
Does anyone have any ideas? Am I missing an easy step? Thanks for your time!

Mike H

Using Lookup Function based on Font Color
 
I din't believe you can do that directly but with a workaround.

Put this function in a general module

Function fontcolour(rng As Range)
fontcolour = rng.Font.ColorIndex
End Function

In a column next to the lookup range enter the formula
=IF(fontcolour(A1)=3,A1,"")
This will extract all the red font values which you can use as the lookup
range

Mike


"jstec68" wrote:

Hello! I have several rows of data currently in which I would like to pull
data from. I could very easily use the LOOKUP function to do this. However,
both the lookup range and vector range are all numbers. I only want the
LOOKUP function to search for LOOKUP Values that are in a certain font color
(red). To my knowledge, the LOOKUP Value can only be a number, text, logical
value, or name or reference to a cell. Font Color is not one of my options.
Does anyone have any ideas? Am I missing an easy step? Thanks for your time!



All times are GMT +1. The time now is 01:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com