title: VBA to loop through set rows
body: <p>I have the code below that updates data on the "Audit Sheet" with specific data from the "Master" sheet, prints the "Audit" sheet and loops until the last row is empty. It works great for a small amount of data, but I have another project that will have over 1800 rows of data. I don't want to clog up the printer with 1800 pages all at once. </p>
  
  <p>What I want is to be able to have a box pop up and specify the beginning row and ending row. I have done this before, but I have forgotten over the years of how I originally wrote the code. Any help is appreciated.</p>
  
  <pre><code>Sub testLoopPaste()
  
  Dim i As Long
  Dim LastRow As Long
  Dim wb As Workbook
  Dim sht1 As Worksheet
  Dim sht2 As Worksheet
  
  Set wb = ThisWorkbook
  Set sht1 = wb.Sheets("Master")
  Set sht2 = wb.Sheets("Audit Sheet")
  
  Application.ScreenUpdating = False
  
  'Find the last row (in column A) with data.
  LastRow = sht1.Range("A:A").Find("*", searchdirection:=xlPrevious).Row
  
  'This is the beginning of the loop
  For i = 2 To LastRow
      'First activity
      sht2.Range("B1" &amp; ii) = sht1.Range("B" &amp; i).Value
      sht2.Range("B2" &amp; ii) = sht1.Range("A" &amp; i).Value
      sht2.Range("B3" &amp; ii) = sht1.Range("N" &amp; i).Value
      sht2.Range("H1" &amp; ii) = sht1.Range("C" &amp; i).Value
      sht2.Range("H2" &amp; ii) = sht1.Range("I" &amp; i).Value
      sht2.Range("H3" &amp; ii) = sht1.Range("F" &amp; i).Value
      sht2.Range("K1" &amp; ii) = sht1.Range("D" &amp; i).Value
  
      sht2.PrintOut
  
  Next i
  
  Application.ScreenUpdating = True
  
  End Sub
  </code></pre>