title: Speed Up Matching Value Processing (If ... = ... Then ...)
body: <p>So I currently have code which looks like this: I'm basically trying to check that if one sheet's column B can be found in another sheet's column C, then I will, in that other sheet's row where I found the B value, take its H column value and copy it to the current sheet's AI column. This process will be repeated for every row in the B column.</p>
  
  <p>The problem I'm encountering is that it's running way too slow, even with turning off screenupdates etc. This makes sense because there are over 50000 values it has to loop through along with all the values it has to lookup. I would really appreciate it if someone could look it through and come up with potential ways i could speed up the process. Thank you.</p>
  
  <pre><code>Sub Calculation()
  
    Application.Calculation = xlCalculationManual
    Application.ScreenUpdating = False
    Application.DisplayStatusBar = False
    Application.EnableEvents = False
    ActiveSheet.DisplayPageBreaks = False
  
    Dim i As Long, LastRow As Long
    LastRow = Range("A" &amp; Rows.Count).End(xlUp).Row
  
    For i = 5 To LastRow
  
    Set wb1 = ThisWorkbook
    Dim anyRow As Long
  
      For anyRow = 4 To 500
        If wb1.Sheets("Total").Cells(anyRow, 2).Value =                    wb1.Sheets("Record").Cells(i, 3).Value Then
          wb1.Sheets("Record").Cells(i, 35).Value =     wb1.Sheets("Total").Cells(anyRow, 8).Value
        End If
      Next anyRow
    Next i
  
    Application.Calculation = xlCalculationAutomatic
    Application.ScreenUpdating = True
    Application.DisplayStatusBar = True
    Application.EnableEvents = True
    ActiveSheet.DisplayPageBreaks = True
  
  End Sub
  </code></pre>