I am using this instruction to try to find out if a cell has conditional format or not to be able to apply one format or another. I do it with this code that I put below, seen as an example on other websites, and it gives me an error of type 13 that the types do not match
Sub PintarFinDeSemana()
' PintarFinDeSemana Macro
Dim formato As FormatCondition
For Each celda In Range("$C$17:$P$71")
If celda.Interior.ColorIndex = 3 Then
Set formato = celda.FormatConditions(1)
Debug.Print "Celda a evaluar: " & celda.Address & vbCr
If Application.Evaluate(formato.Formula1) Then
Debug.Print "Condición activa"
Else
Debug.Print "Sin condición"
End If
End If
Next celda
End Sub
Apparently it is the same as the examples seen, but what is said does not work.
Greetings.