I wanted a macro I wrote to run automatically if a cell in a range changes instead of using a button. This code I used for the macro is as follows:
Function colornumber(myvar As Range)
colornumber = myvar.Interior.ColorIndex
End Function
Function colorcount(myvar As Range, ColVar As Long)
For Each cell In myvar
If cell.Interior.ColorIndex = ColVar Then colorcount = colorcount + 1
Next
End Function
Any help is greatly appreciated!
Function colornumber(myvar As Range)
colornumber = myvar.Interior.ColorIndex
End Function
Function colorcount(myvar As Range, ColVar As Long)
For Each cell In myvar
If cell.Interior.ColorIndex = ColVar Then colorcount = colorcount + 1
Next
End Function
Any help is greatly appreciated!