ThrottleWorks
Excel Ninja
Hi,
I am populating 'Age buckets' using below mentioned code.
However it is taking time.
Can anyone please help me with quicker solution.
Usual time taken is around 4 minutes for 8,000+ rows.
I am populating 'Age buckets' using below mentioned code.
However it is taking time.
Can anyone please help me with quicker solution.
Usual time taken is around 4 minutes for 8,000+ rows.
Code:
Set TempRng = ItemsNotFoundSht.Range(ItemsNotFoundSht.Cells(2, 7), ItemsNotFoundSht.Cells(TempLr, 7))
For Each TRng In TempRng
If ItemsNotFoundSht.Cells(TRng.Row, 1) = "Consider" Then
If ItemsNotFoundSht.Cells(TRng.Row, 3) = "" Then
If TRng.Value < MapSht.Range("E3") Then
ItemsNotFoundSht.Cells(TRng.Row, 3) = MapSht.Range("D2") '0 to 5
End If
If TRng.Value > MapSht.Range("F2") Then
If TRng.Value < MapSht.Range("E4") Then
ItemsNotFoundSht.Cells(TRng.Row, 3) = MapSht.Range("D3") '6 to 10
End If
End If
If TRng.Value > MapSht.Range("F3") Then
If TRng.Value < MapSht.Range("E5") Then
ItemsNotFoundSht.Cells(TRng.Row, 3) = MapSht.Range("D4") '11 to 15
End If
End If
If TRng.Value > MapSht.Range("F4") Then
If TRng.Value <= MapSht.Range("E6") Then
ItemsNotFoundSht.Cells(TRng.Row, 3) = MapSht.Range("D5") '16 to 20
End If
End If
If TRng.Value > MapSht.Range("E6") Then
ItemsNotFoundSht.Cells(TRng.Row, 3) = MapSht.Range("D6") '>20 days
End If
End If
End If
Application.StatusBar = TempLr - TRng.Row
Next TRng