how to stop at the last row selection "R11C14:R10000C14"
I have a sheet where i have a column with data, number of row every time is different, some time i have less data some times more,
how can i stop my conditional formatting at the last row of data
every time the code is going until 10000, but some time i have just 5000 line, so how can i stop it at 5000
the code bellow is for conditional formatting:
Sub Check_Energy_Codes()
Application.Goto Reference:="R11C16:R10000C16"
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=COUNTIF(Hours,P11)=0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
End Sub
I have a sheet where i have a column with data, number of row every time is different, some time i have less data some times more,
how can i stop my conditional formatting at the last row of data
every time the code is going until 10000, but some time i have just 5000 line, so how can i stop it at 5000
the code bellow is for conditional formatting:
Sub Check_Energy_Codes()
Application.Goto Reference:="R11C16:R10000C16"
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=COUNTIF(Hours,P11)=0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
End Sub