Dear all,
having this macro involved in my list, it takes ages until it is done (200 sec aprox.). As it should be just a part of longer macro, I need to figure out, how to speed it up.
Any idea I can understand? ( I am macro begginers. :-) )
This code should be instead of VLOOKUP function. TREndRow has value 1500, PocetBridge around 4000. It goes one by one - I thing that is why is is so slow.
Sub svyhledatBridge()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.Calculation = xlCalculationManual
Dim TBEndRow As Long
TBEndRow = Sheets("Trial Balance").Range("B9").End(xlDown).Row
Dim pocetBridge As Long
pocetBridge = Sheets("Bridge").Range("A2").End(xlDown).Row
'
For j = 2 To pocetBridge
For i = 4 To TBEndRow
If Sheets("Trial Balance").Cells(i, 20) = Sheets("Bridge").Cells(j, 1) Then
Sheets("Trial Balance").Cells(i, 24) = Sheets("Bridge").Cells(j, 7)
Exit For
End If
Next i
Next j
Application.ScreenUpdating = True
Application.DisplayAlerts = True
Application.Calculation = xlCalculationAutomatic
End Sub
Bookmarks