Hello All,
I have a spreadsheet which needs to copy an entire row to a new sheet "Winners" should a "1" appear in column AA. So I a "1" appears in AA10 as an example, the whole of AA10 should be copied to sheet "winners", each time a calculation updates and a 1 is found, the whole row should be copied.
It fails with an error 424 object required.
Any ideas anyone?
Thanks!
I have a spreadsheet which needs to copy an entire row to a new sheet "Winners" should a "1" appear in column AA. So I a "1" appears in AA10 as an example, the whole of AA10 should be copied to sheet "winners", each time a calculation updates and a 1 is found, the whole row should be copied.
VBA Code:
Private Sub Worksheet_Calculate()
If Application.CountIf(Range("AA2:AA50"), "1") > 0 Then
a = Sheets("Winners").Cells(Rows.Count, "A").End(xlUp).Row + 1
'it breaks on the line below
target.EntireRow.Copy Destination:=Sheets("Winners").Range("A" & a)
End If
End Sub
It fails with an error 424 object required.
Any ideas anyone?
Thanks!