[ad_1]
Hello I have the following code to try to check if every colors are the same to change the color of the caller, but for an unknown reason, it keep saying : falcultative argument missing, even thought I filled the function, when executing it, with cells arguments (S6:T6). So does anyone know how to it please ?
Function VerifCouleurs(cellules As Range)
Application.Volatile
Dim onglet As Worksheet
Dim good As Double
Dim cellule As Range
good = Range.Count
For Each cellule In cellules
If cellule.Interior.Color = onglet.Cells(2, 25) Then
good = good + 1
End If
Next
If good = cellule.Count Then
Application.Caller.Interior.Color = onglet.Cells(2, 25)
ElseIf good <> cellule.Count Then
Application.Caller.Interior.Color = onglet.Cells(3, 25)
Else
Application.Caller.Interior.Color = onglet.Cells(4, 25)
End If
End Function
[ad_2]