Hi,
I've put together a macro to copy/paste entire rows if the cell in column A contains a value. The aim is to have the macro paste in the first empty row in a sheet called Store. The problem is I keep getting an error - the debugger highlights the Rows.Count line.
Can anyone see what the issue is?
Thanks
I've put together a macro to copy/paste entire rows if the cell in column A contains a value. The aim is to have the macro paste in the first empty row in a sheet called Store. The problem is I keep getting an error - the debugger highlights the Rows.Count line.
Can anyone see what the issue is?
Thanks
VBA Code:
Sub CopyToStore()
Dim c As Range
Dim Source As Worksheet
Dim Target As Worksheet
Set Source = ThisWorkbook.Worksheets("Input")
Set Target = ThisWorkbook.Worksheets("Store")
For Each c In Source.Range("A8:A300")
If c <> "" Then
Source.Rows(c.Row).Copy
Target.Range("A" & .Rows.Count).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues
End If
Next c
End Sub