I have a sheet (Data_View) with 300 rows of information. In column A, there is a checkbox for each row (checked box = TRUE). If a given row’s checkbox is clicked, I need that row’s information to be copied and pasted (values only) to a separate worksheet (Selected_Items). I can write code to do this for a specific row, but I don’t know how to write a loop that will check all 300 rows for the condition, copy only the checked rows, then paste the copied data into successive rows in Selected_Items sheet.
I’ve attempted to modify code from other posts related to this topic, but I'm a VBA novice and I haven’t gotten it right yet. My efforts thus far are available for advice (and mockery) below. Any help would be greatly appreciated.
</PRE>
I’ve attempted to modify code from other posts related to this topic, but I'm a VBA novice and I haven’t gotten it right yet. My efforts thus far are available for advice (and mockery) below. Any help would be greatly appreciated.
Code:
Dim rng As Range
Dim row As Range
Dim cell As Range
Dim nextrow as Long
Nextrow = Sheets.(“Selected_Items”).cells(Rows.Count, “A”).End(xlUp).Row +1
Set rng = Range("A2:BD2")
Sheets(“Data_View”).Select
For Each row In rng.Rows
For Each cell in row.Cells
If Range(“A”).value = True then row.copy
Sheets("Selected_Items").Cells(nextrow, “A”).PasteSpecial Paste:=xlValues
Next cell
Next row
End if
End sub
</PRE>
Last edited: