mailmaster
New Member
- Joined
- Jun 13, 2010
- Messages
- 14
I have this two functions in a module:
But when I see the condicional format of any cell of the range the condition is correct but the format is not set.
I really don't know what's going on.
Any help??
TIA
Function IsNotFormula(rRango As Range) As Boolean
IsNotFormula = True
If rRango.HasFormula = True Then
IsNotFormula = False
End If
End Function
And when I try to trace it, the execution is missed in the line:Sub marcaSinformulas(rRango As Range)
Dim miCondicion As FormatCondition
Dim sPrimeraCelda As String
Dim sCondicion As String
Dim rCelda As Range
rRango.FormatConditions.Delete
For Each rCelda In rRango.Cells
sPrimeraCelda = rCelda.Cells(1, 1).Address
sPrimeraCelda = Replace(sPrimeraCelda, "$", "")
sCondicion = "=IsNotFormula(" & sPrimeraCelda & ")"
On Error Resume Next
rCelda.FormatConditions.Add Type:=xlExpression, Formula1:=sCondicion
rCelda.FormatConditions(1).Interior.ColorIndex = 36
Next
End Sub
It doesn't matter if I put the linerCelda.FormatConditions.Add Type:=xlExpression, Formula1:=sCondicion
or not.On error resume next
But when I see the condicional format of any cell of the range the condition is correct but the format is not set.
I really don't know what's going on.
Any help??
TIA