ThrottleWorks
Excel Ninja
Hi,
I am using below mentioned loop. Last row is 75,000 +.
This loop is taking too much time to complete.
Could you please suggest how can I make this loop run faster.
I tried edited version of below code.
But this is also not making any difference.
I am using below mentioned loop. Last row is 75,000 +.
This loop is taking too much time to complete.
Could you please suggest how can I make this loop run faster.
Code:
For Each TRng In TempRng
Application.StatusBar = TRng.Row
MySht.Cells(TRng.Row, 1).FormulaR1C1 = "=IF(AND(COUNTIFS(C[1],RC[1],C[9],""QQ*"")>0,COUNTIFS(C[1],RC[1],C[9],""WW*"")>0),""A"",""B"")"
MySht.Cells(TRng.Row, 1).Value = MySht.Cells(TRng.Row, 1).Value
Next TRng
Application.StatusBar = False
I tried edited version of below code.
But this is also not making any difference.
Code:
Sub test()
Dim varray As Variant
Dim i As Long
varray = Range("A2:A10").Value
'must step back or it'll be infinite loop
For i = UBound(varray, 1) To LBound(varray, 1) Step -1
'do your logic and evaluation here
If varray(i, 1) = "foo" Then
'not how to offset the i variable
Range("A" & i + 2).EntireRow.Insert
End If
Next
End Sub