Aşağıdaki kodlamayı boş bir Excel uygulaması açıp Visual Basic (Alt + F11) kod sayfasına geçip buradan Sayfa1’i seçip yapıştır işaretlemesi ile kodlamayı dahil ediniz.ardından da,excel uygulamasını Dosya - Farklı Kaydet – Excel Makro Etkin Çalışma Kitabı şeklinde kaydediniz.
Kod:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
ActiveCell.Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
Formula1:="=50", Formula2:="=100"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Color = vbBlack
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlNotBetween, _
Formula1:="=50", Formula2:="=100"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Color = vbRed
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
End Sub
İyi çalışmalar,
saygılar.