0% found this document useful (0 votes)
14 views1 page

Contar Celdas por Color en Excel

This VBA function counts the number of cells in a given range that have the same interior color as a source cell. It iterates through each cell in the range, compares its interior color property to the source cell, and increments the count if they match. The function is declared as volatile so it automatically recalculates when cells it depends on change.

Uploaded by

Gr Alex
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views1 page

Contar Celdas por Color en Excel

This VBA function counts the number of cells in a given range that have the same interior color as a source cell. It iterates through each cell in the range, compares its interior color property to the source cell, and increments the count if they match. The function is declared as volatile so it automatically recalculates when cells it depends on change.

Uploaded by

Gr Alex
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Function CONTARCOLOR(celdaOrigen As Range, rango As Range)

[Link]

'Variables
Dim celda As Range

'Recorremos todas las celdas del rango


For Each celda In rango

'Compara la propiedad [Link]


If [Link] = [Link] Then
CONTARCOLOR = CONTARCOLOR + 1
End If

Next celda

End Function

You might also like