title: Spark Lines and DO-loops
body: <p>I have a workbook with several sheets. </p>
  
  <p>One of the sheets "Calc" summarizes the data for 8 spark lines I have presented on a summary page based on an employee ID number entered on the summary page. </p>
  
  <p>I have a created DO-loop macro to run this summary sheet by employee ID# and convert to a PDF and save by ID number. </p>
  
  <p>Works like a charm and saves hours of time (literally). Trouble is two of the spark lines will not update. </p>
  
  <p>I feel like Excel going to fast to allow them to update. </p>
  
  <p>I have tried to put in a delay, <code>Application.Wait(Now + TimeValue("00:00:01"))</code>, and have gone up to two minutes... No luck. Any ideas?</p>
  
  <pre><code>Option Explicit
  
  Sub PDFtool()
  
      On Error GoTo errorHandle:
  
      Dim i As Integer
      i = 2
  
      Dim main, dataname, path, filename, ID As String
  
      path = Cells(5, 4)
      main = ActiveWorkbook.Name
  
      filename = ActiveWorkbook.path &amp; "\" &amp; "PDF files " &amp; Format(Now(), "yyyy mm dd hh mm")
      MkDir filename
  
      Workbooks.Open filename:=path
      dataname = ActiveWorkbook.Name
  
      Do
          Worksheets("AM Location &amp; ID#").Activate
          If Cells(i, 1) = "" Then Exit Do
          ID = Cells(i, 3)
          Worksheets("AM").Activate
          Cells(190, 1) = ID
  
          Worksheets("AM").Calculate
  
          ActiveSheet.ListObjects("Table33").Range.AutoFilter Field:=1, Criteria1:= _
          "TRUE"
          Columns("H:N").Select
          Selection.EntireColumn.Hidden = True
  
          ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _ 
              filename:=filename &amp; "/" &amp; ID &amp; ".pdf", _ 
              Quality:=xlQualityStandard, IncludeDocProperties:=True, _  
              IgnorePrintAreas:=False, OpenAfterPublish:=False                                        
  
          Columns("G:S").Select
          Selection.EntireColumn.Hidden = False
          ActiveSheet.ListObjects("Table33").Range.AutoFilter Field:=1
  
          i = i + 1
  
      Loop
  
      Application.ScreenUpdating = True
  
      End
  
  
      errorHandle:
          Application.ScreenUpdating = True
          MsgBox ("ERROR! Call Greg")
          End
  
  End Sub
  </code></pre>