So here is my code , im trying to compare a sheet containing 3000 rows with another one of 5000 rows, however it is working too slow, can anyone help ?
Dim G As Long
Dim K As Long
Dim CardBrand As String
Dim STD As String
Dim CardBrand2 As String
Dim ASI
Dim ID As String
Dim X As Workbook
Dim FinalRow As Long
Dim Finalrow2 As Long
Dim I As Long
Dim TC_STD As String
Dim TC_ASI As String
Dim TC_Perc As Double
Dim TC_Base As Double
Dim TC_ID As String
Application.ScreenUpdating = False
FinalRow = Cells(Rows.Count, "I").End(xlUp).Row
For G = 5 To FinalRow
CardBrand = Sheets("sheet1").Cells(G, 9).Value
STD = Sheets("sheet1").Cells(G, 10).Value
ID = Sheets("sheet1").Cells(G, 5).Value
For K = 2 To 51
CardBrand2 = Sheets("sheet2").Cells(K, 3).Value
If CardBrand = CardBrand2 Then
ASI = Sheets("sheet2").Cells(K, 1).Value
Set X = Workbooks.Open("E:\Partner_Commission_Compiler\Repository\Transaction_Charges.xlsx")
Finalrow2 = X.ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
For I = 1 To Finalrow2
TC_ASI = X.ActiveSheet.Cells(I, 6).Value
TC_STD = X.ActiveSheet.Cells(I, 11).Value
TC_ID = X.ActiveSheet.Cells(I, 1).Value
If (TC_ASI = ASI) And (TC_STD = STD Or TC_STD = "All") And TC_ID = ID Then
TC_Perc = X.ActiveSheet.Cells(I, 19).Value
TC_Base = X.ActiveSheet.Cells(I, 20).Value
ThisWorkbook1.Sheets("Sheet1").Activate
Sheets("sheet1").Cells(G, 13).Value = TC_Perc
Sheets("sheet1").Cells(G, 14).Value = TC_Base
End If
Next I
End If
Next K
Next G
X.Close (False)
Application.ScreenUpdating = True