I am trying to take a range of cells (column B to be specific) and find the cells in that range that have a value less than zero and clear the contents of those cells. Is there a way to do this without looping through every single cell? The column is a very large data set that gets longer each week so looping takes a significant amount of time.
Below is the current loop I am using
Dim sht As Worksheet
Dim LastColumn As Long
Set sht = ThisWorkbook.Worksheets("Sheet1")
lastrow = sht.Cells.Find("*", SearchOrder:=xlByRows,
searchdirection:=xlPrevious).Row
for i=1 to lastrow
if sheets("time").cells(i, "B") then
sheets("time").cells(i, "B").clear
end if
next i
The cells I am trying to examine and then potentially delete contain formulas
edit: The answer marked as accepted sped up the process but still requires a loop. If anyone has anything that would be faster than what is posted feel free to add it.


VBA, but you could alternatively just put a filter on the cells, and filter out all positive values, then just clear the remaining visible cells - BruceWayne