View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default possible to do a vlookup using colorindex?

You might find some useful code for the array at
http://www.xldynamic.com/source/xld.ColourCounter.html

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"David Adamson" wrote in message
...
I need to do a vlookup based on the colorindex property of a cell. Is it
possible?

What I have is a series of cells that change colour and the value needs to
update


Dim find As Double
Dim location As Range
Dim res As Double

With Worksheets("trial")
find = .Range("b4").Interior.ColorIndex
Set location = .Range("s3:r12")
End With

res = Application.WorksheetFunction.VLookup(find, location, 2, 0)

The other thing I was also attempting was to populate an array or list
with the colorindex. Then if possible use listindex and use offset to get
the value I needed but my brain is fried and any suggestions would be
appreciated