thunderzhao
11-13-2011, 05:54 AM
Hi guys, i'm trying to write a function that returns an array of 1's and 0's to indicate match or not match of a range.
Function Countcolour(rng As Range, colour As Range) As Integer
Dim c As Range
Dim i As Integer
Dim ColorMatch() As Integer
i = 0
Application.Volatile
For Each c In rng
ColorMatch(i) = 0
If c.Interior.ColorIndex = colour.Interior.ColorIndex Then
ColorMatch(i) = 1
End If
Next
End Function
Can someone fix it for me.
Thanks a million
Function Countcolour(rng As Range, colour As Range) As Integer
Dim c As Range
Dim i As Integer
Dim ColorMatch() As Integer
i = 0
Application.Volatile
For Each c In rng
ColorMatch(i) = 0
If c.Interior.ColorIndex = colour.Interior.ColorIndex Then
ColorMatch(i) = 1
End If
Next
End Function
Can someone fix it for me.
Thanks a million