I have this macro that copies all cells with a 'grey fill' from sheet 1 to sheet 2.
It's suddenly only started copying and pasting the first one it hits in a column, not the rest.
Can anyone spot why this is happening?
In the new data I'm checking, the data starts (D2) with an empty row, could this be affecting it?
Thanks for any input.
Sub copyNotFound()
Application.ScreenUpdating = False
Dim TransIDField As Range
Dim TransIDCell As Range
Dim ATransWS As Worksheet
Dim HTransWS As Worksheet
Set ATransWS = Worksheets("1")
Set TransIDField = ATransWS.Range("D2", ATransWS.Range("D2").End(xlDown))
Set HTransWS = Worksheets("2")
For Each TransIDCell In TransIDField
If TransIDCell.Interior.color = RGB(231, 230, 230) Then
TransIDCell.Resize(1, 1).copy Destination:= _
HTransWS.Range("M1").Offset(HTransWS.Rows.Count - 1, 0).End(xlUp).Offset(1, 0)
End If
Next TransIDCell