Please add code tags as per forum rules.
Please add code tags as per forum rules.
![]()
Function EstFormula(rng As Range) As Boolean EstFormula = 0 If rng.HasFormula = True Then EstFormula = 1 'do nothing Else EstFormula = 0 rng.AddComment rng.Comment.Text Text:="Value edited manually" End If End Function Private Sub Cell_format() Dim p As Integer p = 3 Do While ActiveSheet.Range("J" & p) <> Empty ActiveSheet.Range("J" & p).Select Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=""EstFormula(Range(""$" & "J" & "$" & p & "))=0""" Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority With Selection.FormatConditions(1).Interior .PatternColorIndex = xlAutomatic .Color = 49407 .TintAndShade = 0 End With Selection.FormatConditions(1).StopIfTrue = False p = p + 1 Loop End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks