Dear ALL,
I made a code to assign conditional formating on one specific rage. That range change as with the entries and on column F if the data is 4; column B to F for that row should be strike through and red color. However, something is wrong.If I check the individual cell's conditional formating; formula does not math with the code.Example, when I check B2; conditional formatting formula appears =$F65534=4 instead of =$F2=4.
Anybody to help me with this code, I would greatly apperiaciated.
Baha
I made a code to assign conditional formating on one specific rage. That range change as with the entries and on column F if the data is 4; column B to F for that row should be strike through and red color. However, something is wrong.If I check the individual cell's conditional formating; formula does not math with the code.Example, when I check B2; conditional formatting formula appears =$F65534=4 instead of =$F2=4.
Anybody to help me with this code, I would greatly apperiaciated.
Baha
Code:
Sub DisplayExSwing1()
Dim LastRow As Long
Dim cel As Range
LastRow = Sheets("ExSwing").Range("A65536").End(xlUp).Row
For Each cel In Sheets("ExSwing").Range("B2:F" & LastRow)
cel.FormatConditions.Add Type:=xlExpression, Formula1:="=$F" & cel.Row & "=4"
With cel.FormatConditions(1).Font
.Strikethrough = True
.Color = 255
End With
cel.FormatConditions(1).StopIfTrue = True
Next cel
Sheets("ExSwing").Range("IP1") = 1
Columns("C:C").ColumnWidth = 15
End Sub