I'm trying to declare a constant that I can call in an if statement. The excerpt of code below is supposed to search all cells in column E and find where the value is equal to or less than 14. If it is, then the script will clear the contents of the entire row.
Any help would be appreciated. Thanks all.
Code:
Dim u1 As Range
Const conAGEy As Integer = 14
Set u1 = ThisWorkbook.Worksheets("Sheet1").Range("B2").CurrentRegion
With u1.Offset(1, 0).Resize(u1.Rows.Count, u1.Columns.Count)
Last = Cells(Rows.Count, "A").End(xlUp).Row
For i = Last To 2 Step -1
If (Cells(i, "E").Value) <= conAGEy Then 'Constants are not working here
Cells(i, "A").EntireRow.ClearContents
End If
Next i
End With
Any help would be appreciated. Thanks all.