Cross posted at :
Copy Paste Rows
My project requires copying rows with CheckBoxes marked as TRUE beginning at row 11 and down to rows used. Then pasting those rows
to a second sheet, beginning at row 1 in Column A.
Here is my attempt at doing so. The issue I am running into is getting the macro to identify the first row with a "True" checkbox in Column E.
I don't know if the copy/paste will function as desired as my current macro doesn't do anything. No errors / no remarks ... it just quickly goes
through whatever motions it is going through, stops but nothing is copied or pasted.
Thank you for your assistance.
Code:
Copy to clipboard
Sub CopyRows()
Dim chkbx As CheckBox
Dim r As Long
Dim LRow As Long
For Each chkbx In ActiveSheet.CheckBoxes
If chkbx.Value = 1 Then
For r = 1 To Rows.Count
If Cells(r, 6).Top = chkbx.Top Then
With Worksheets("Sheet2")
LRow = .Range("A" & Rows.Count).End(xlUp).Row + 1
.Range("A" & LRow & ":D" & LRow) = _
Worksheets("Sheet1").Range("E" & r & ":J" & r).Value
End With
Exit For
End If
Next r
End If
Next
End Sub
Here is the range affected with the above macro (attached).
Workbook file is attached as well.