I have VBA code to make my column WEEKNUM formula say "Late" if it is in a certain range of weeks. The formula turns the week number into the word "Late" when the code is run; however, this goes to a pivot table on the sheet over and the "Late" values are not showing up when the table is refreshed since it is still in the form as a formula. Is there a way that whenever the WEEKNUM value is "Late" to clear out the cell and enter the text "Late"? Better yet can the formula output be replaced with a text value?
With MyWorkbook.Worksheets("sheet2")
With .Range(.Cells(2, "X"), .Cells(.Rows.Count, "O").End(xlUp).Offset(0, 9))
.Formula = "=weeknum(o2)"
.NumberFormat = "0_)"
.FormatConditions.delete
With .FormatConditions.Add(Type:=xlExpression, Formula1:="=and(x2<weeknum(today()), year(o2)=year(today()))")
.NumberFormat = "\L\a\t\e_)"
End With
End With
End With