In “Original 1” information is entered into rows, then each row is marked with an “D” or “C” in column A. The code below is a macro that runs when a button is clicked. It is supposed to look in column A and any rows marked with a C need to be copied and then pasted into worksheet “Data.” If there are 5 rows total with 3 marked with a C then those 3 should be copy and pasted over to the Data worksheet. I do not understand why but I believe that instead of pasting into the next empty row in “Data” so you could see all 3 rows that were marked with a C, it is pasting into the same row each time so that only the last row that was pasted is visible.
Dim c As Object
Dim xRow As Range
Dim ws As Worksheet
Dim wx As Worksheet
Dim wy As Worksheet
Dim Firstrow As Long
Dim Lastrow As Long
Set ws = Worksheets("Data")
Set wx = Worksheets("CR")
Set wy = Worksheets("CRL")
ws.Range("A2:E46").ClearContents
Sheets("Original 1").Select
For Each c In Range("A11:A25")
If c.Value = "c" Or c.Value = "C" Then
Range(c.Offset(0, 2), c.Offset(0, 5)).Copy
ws.Cells(ws.Cells(Rows.Count, 1).End(xlUp).Offset(0, 0).Row, 1).Offset(1, 0) _
.PasteSpecial Paste:=xlPasteValues
End If
Next c
Bookmarks