im trying to work on a simple program that it will highlight all cells with a value of 5 or less and VB is not my strong point. The problem is it highlights a million cells in the column because empty is less than 5. this is the code I'm using. I fumbled through forums for a day to get this far. I have a "Next without For" error. Any help will be greatly appreciated thanks.
Code:
Sub numfinder()
Dim cell As Range
Dim NewRange As Range
Dim MyCount As Long
MyCount = 1
For Each cell In Range("F5:F116")
If cell.Value = Empty Then Next cell
If cell.Value <= 5 Then
If MyCount = 1 Then Set NewRange = cell
Set NewRange = Application.Union(NewRange, cell)
MyCount = MyCount + 1
End If
Next cell
NewRange.Interior.ColorIndex = 8
End Sub