Hi All,

I'm hoping someone can help me please? I'm new to VBA and I'm struggling with the following code. I'm trying to copy rows where a certain column is greater than 14. However when I run this VBA in a module I am getting a record that is less than 14. This is only happening on one record, although there are other values in that column under 14. I have used a "helper column" as the original one had a calculation in, however I'm still getting the same problem.

Also I want the data to overwrite every time the button is pressed, but I don't know what command to use for that.

Thanks in advance.

Sub copyPaste()
Dim ws As Worksheet
Dim wt As Worksheet
Set ws = Sheets("S_Q")
Set wt = Sheets("total")
Dim i As Integer
Dim lr As Integer
lr = ws.Range("y" & Rows.Count).End(xlUp).Row
Dim lt As Long

For i = 1 To lr
lt = wt.Range("y" & Rows.Count).End(xlUp).Row
If ws.Range("bz" & i) > "14" Then
ws.Range("y" & i).EntireRow.Copy wt.Range("a" & lt + 1)
End If
Next i
End Sub