View Single Post
      09-11-2007, 09:20 AM   #5
silverbmwz3
Colonel
48
Rep
2,022
Posts

Drives: X5 g05
Join Date: Mar 2007
Location: Buckinghamshire, UK

iTrader: (0)

Garage List
OK, here's one, glad you know VBA!

Public Function mycount(oColourToLookFor As Range, oRangeToSearch As Range)

Dim oCell As Range
Dim iFound As Long

iFound = 0

For Each oCell In oRangeToSearch

If oCell.Interior.ColorIndex = oColourToLookFor.Interior.ColorIndex Then
iFound = iFound + 1
End If

Next

mycount = iFound

End Function


Basically you point it at the colour you want to look for (i'd put this say next to your key and point it at each one -ie repeat the call for each one, and point it at the range you want to search (i.e. a single column of those resuls)
__________________
Current: E90 335d (May 2007) | Black/Black | Prof Hifi | Prof Nav | 6FL | Fully Electric Seats | Xenons | Folding Mirrors | PDC
Previous: 325ci Conv. Black/Black with lots of ACS
Previous: z3 3.0 Silver with Black&Red Leather
Appreciate 0