title: Is there a better alternative than a loop to reduce processing time?
body: <p>I am cycling through <code>values</code> on a pending data list and then updating a master list if any of those values are new.  The pending list will normally have 100-200 <code>rows</code> of data and each <code>row</code> will have about 10 <code>variables</code> that it will need to make sure are updated on the master list.  The Master list is about 10,000 <code>rows</code>.</p>
  
  <p>I have written code that will <code>loop</code> through <code>each row</code> of the pending list, assign <code>values</code> to <code>variables</code> and then perform a <code>find</code> on the master list looking for a matching record and then update it accordingly.  My code works fine and does exactly what I want but the processing time is about 4 minutes and that's 3 minutes and 50 seconds longer than the people that use it are willing to allow without complaining.  </p>
  
  <p>Is there alternative coding that I could use to help decrease processing time?</p>
  
  <p>The code I have is very long and so I am not going to paste it all here but instead paste snip-its of it so you can have an idea of what I am currently doing:  </p>
  
  <pre><code>Application.Screenupdating = False
  Applicaiton.Enableevents = False
  Application.Calculation = xlCalculationManual
  
  PendingBRow = ThisWorkbook.Sheets("PendingLog").Range("A65000").End(xlUp).Row
  MasterBRow = ThisWorkbook.Sheets("MasterLog").Range("A65000").End(xlUp).Row
  
  For D = 2 To PendingBRow
  With ThisWorkbook.Sheets("PendingLog").Range("A" &amp; D)
  PendingRecordNumber = .Value
  PendingIR = .offset(0, 5).Value
  PendingVal = .offset(0, 6).Value
  End With
  
  With ThisWorkbook.Sheets("MasterLog").Range("B2:B" &amp; MasterBRow)
  Set c = .Find(PendingRecordNumber, LookIn:=xlValues)
  If Not c Is Nothing Then
          firstAddress = c.Address
          Do
  DaysSinceLastWorkedStatic = c.offset(0, 22).Value
  
  
  MasterIRValue = c.offset(0, 16).Value
              If PendingIR &lt;&gt; 0 Then
              If PendingIR &lt;&gt; MasterIRValue Then
              c.offset(0, 16).Value = PendingIR
              DaysSinceLastWorkedStatic = 0
              c.offset(0, 22).Value = DateVal
              End If
              End If
  
              c.offset(0, 24).Value = POorLA
              c.offset(0, 25).Value = FinalizedFlag
              Set c = .FindNext(c)
          Loop While Not c Is Nothing And c.Address &lt;&gt; firstAddress ' in rare cases a record number could be duplicated on the master list.  
  
  
  end if
  end with
  
  ThisWorkbook.Sheets("PendingLog").Range("A" &amp; D).offset(0, 15).Value = DaysSinceLastWorkedStatic
  Next D
  </code></pre>
  
  <p>One alternative I had considered was to filter the master list by the record number and update the visible row only and then unfilter for each record number on the pending list. I have not yet tested this method.  </p>
  
  <p>Could this method be better than what I have?</p>