but I need it count a merged cell as a single cell
Yes, and that is what my posted sub does.
RBS
dsamson wrote:
The code I was working with is:
Function CountByColor(InputRange As Range, ColorRange As Range) As
Long
Dim cl As Range, TempCount As Long, ColorIndex As Integer
ColorIndex = ColorRange.Cells(1, 1).Interior.ColorIndex
TempCount = 0
For Each cl In InputRange.Cells
If cl.Interior.ColorIndex = ColorIndex Then
TempCount = TempCount + 1
End If
If cl.MergeCells = True Then
Next cl
End If
Next cl
Set cl = Nothing
CountByColor = TempCount
End Sub
This works well, but I need it count a merged cell as a single cell,
vice the number of cells merged.
Thanks.
--
dsamson
------------------------------------------------------------------------
dsamson's Profile: http://www.excelforum.com/member.php...o&userid=35528
View this thread: http://www.excelforum.com/showthread...hreadid=552955