![]() |
|
#1
|
|||
|
|||
|
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
Workbook file is attached as well. |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Copy and Paste certain columns from selected rows.
|
14spar15 | Excel Programming | 2 | 05-18-2023 07:57 AM |
Is it possible to copy non-contiguous rows of a Table and paste them as a separate Table in Word?
|
Joey Cheung | Word Tables | 1 | 08-12-2014 05:15 PM |
| how can i split a column of rows in half without copy and paste.. | Lindseyfparker | Excel | 2 | 04-25-2014 12:52 AM |
Find specific rows then copy and paste to new doc
|
konopca | Word VBA | 5 | 02-20-2014 02:34 PM |
| Why cant I just copy/paste new flippin rows into a flippin table? | jethrouk | Word | 8 | 11-17-2013 06:09 PM |