I am trying to make the VBA that highlights the entire row if the row contains a word "New".
The applying range of conditional formatting, I am trying to put maybe A1 till AZ2000
the reason, I also had a problem setting range as whole worksheet.
I never learned VBA so I am getting information from internet
I wrote this much but it is not working, to my knowledge, it should work but i don't know why it is not working, it is frustrating how, I fix one, and another problem comes up...lol
Sub Highlighting()
'Definining the variables:
Dim rng As Range
Dim condition1 As FormatCondition
'Fixing/Setting the range on which conditional formatting is to be desired
Set rng = ("A1, AZ2000")
'To delete/clear any existing conditional formatting from the range
ws.FormatConditions.delete
'This is where I get Syntax error, it says "New" needs list separator
Set condition1 = ws.FormatConditions.Add(xlConditionValueFormula, xlGreater, "=FIND(""New"",$AF1)>0)")
'Defining and setting the format to be applied for each condition
With condition1
.EntireRow.Interior.ColorIndex = 10498160
End With
End Sub
this is how i want it set up in VBA