I have the script:
Which works well but is very slow because about 80% of the values in the range will never satisfy the condition and have a value of "-1".
Does anyone know how to have VBA determine which cells In the array "r" have the value of -1 so that they are ignored, making the script much faster?
Thank you.
Code:
Sub Numbers()
Dim r As Range, c As Range, i As Currency
Set r = Range("E2210:EHQ3408")
For Each c In r
For i = 1 To 1800
If c.Value >= i / 10 And c.Value <= i / 10 + 0.1 Then
Cells(Rows.Count, i + 3650).End(xlUp).Offset(1).Value = c.Offset(-1811).Value
Exit For
End If
Next i
Next c
End Sub
Which works well but is very slow because about 80% of the values in the range will never satisfy the condition and have a value of "-1".
Does anyone know how to have VBA determine which cells In the array "r" have the value of -1 so that they are ignored, making the script much faster?
Thank you.