title: Script in where it copies a sheet's data, and pastes it, but over pastes
body: <p>Here is my script.</p>
  
  <pre><code>Sub Update_OOR()
  
      Dim wsTNO As Worksheet
      Dim wsTND As Worksheet
      Dim wsTNA As Worksheet
      Dim lastrow As Long, fstcell As Long
  
      Set wsTNO = Sheets("Tel-Nexx OOR")
      Set wsTND = Sheets("Tel-Nexx Data")
      Set wsTNA = Sheets("Tel-Nexx Archive")
  
      With Application
          .ScreenUpdating = False
          .DisplayAlerts = False
          .EnableEvents = False
      End With
  
      With Intersect(wsTNO.UsedRange, wsTNO.Columns("S"))
          .AutoFilter 1, "&lt;&gt;Same"
          With Intersect(.Offset(2).EntireRow, .Parent.Range("B:P"))
              .Copy wsTNA.Cells(Rows.Count, "B").End(xlUp).Offset(1)
              .EntireRow.Delete
          End With
          .AutoFilter
      End With
  
  
  'Blow away rows that are useless
      lastrow = wsTND.Range("A2").End(xlDown).Row
      wsTND.Range("O1:P1").Copy wsTND.Range("O2:P" &amp; lastrow)
      wsTND.UsedRange.Copy Sheets.Add.Range("A1")
  
      With Intersect(ActiveSheet.UsedRange, ActiveSheet.Columns("P"))
          ActiveSheet.Range("O:P").Calculate
          .AutoFilter 1, "&lt;&gt;Different"
          .SpecialCells(xlCellTypeVisible).EntireRow.Delete
      End With
  
      With ActiveSheet
          lastrow = wsTND.Range("A2").End(xlDown).Row
          Intersect(.UsedRange, .Range("A2:M" &amp; lastrow)).Copy wsTNO.Cells(Rows.Count, "B").End(xlUp).Offset(1)
          .Delete
      End With
  
      With wsTNO
          lastrow = wsTNO.Cells(Rows.Count, "B").End(xlUp).Row
          wsTNO.Range("T1:AD1").Copy
          wsTNO.Range("B3:N" &amp; lastrow).PasteSpecial xlPasteFormats
          lastrow = wsTNO.Cells(Rows.Count, "R").End(xlUp).Row
          fstcell = wsTNO.Cells(Rows.Count, "N").End(xlUp).Row
          wsTNO.Range("AE1:AI1").Copy wsTNO.Range("O" &amp; fstcell &amp; ":S" &amp; lastrow).Offset(1, 0)
      End With
  
      With Application
          .ScreenUpdating = True
          .DisplayAlerts = True
          .EnableEvents = True
      End With
  
  End Sub
  </code></pre>
  
  <p>It technically works perfectly till here:</p>
  
  <pre><code>With wsTNO
          lastrow = wsTNO.Cells(Rows.Count, "B").End(xlUp).Row
          wsTNO.Range("T1:AD1").Copy
          wsTNO.Range("B3:N" &amp; lastrow).PasteSpecial xlPasteFormats
          lastrow = wsTNO.Cells(Rows.Count, "R").End(xlUp).Row
          fstcell = wsTNO.Cells(Rows.Count, "N").End(xlUp).Row
          wsTNO.Range("AE1:AI1").Copy wsTNO.Range("O" &amp; fstcell &amp; ":S" &amp; lastrow).Offset(1, 0)
  End With
  </code></pre>
  
  <p>Now technically everything in this part works correctly, but the last line in the code, it pasts everything correctly, then it goes one step beyond. I'd like to know why. If I get rid of the offset it overwrites what is in the cell above in O through S. I need to know the first and last cell, because the data needs to be only written to a specific cell range.  </p>
  
  <p>If there is an easier way of doing this it be appreciated if someone could tell me, if not then can someone tell me how to fix this?</p>
  
  <p>Thanks.</p>
  
  <p>Attached is the workbook.</p>
  
  <p><a href="http://dl.dropbox.com/u/3327208/Excel/First%26LastRows.xlsm" rel="nofollow">http://dl.dropbox.com/u/3327208/Excel/First%26LastRows.xlsm</a></p>