Add the following code lines to a command button on your worksheet: Create a variable of type Long named i. Because Long variables have more capacity than Integer variables, we utilize a variable of type Long here. Dim i As Long  Then, in column A, add the code line that changes the font color of all the cells to black. Columns(1).Font.Color = vbBlack Add the loop. For i = 1 To Rows.Count Next i In Excel 2007 and later, worksheets can have up to 1,048,576 rows. The code line above repeats through all rows, regardless of which version you’re using. Then we color all values that are less than the value entered in cell D2 with a different color. Empty cells are not taken into account. To the loop, add the following lines of code. If Cells(i, 1).Value < Range(“D2”).Value And Not IsEmpty(Cells(i, 1).Value) Then Cells(i, 1).Font.Color = vbRed End If