![]() |
|
#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. |
#2
|
|||
|
|||
![]()
I've done considerable research concerning this issue. Apparently VBA isn't designed to copy CheckBoxes. VBA can copy a simple character "X" that is placed in a cell.
So ... the textboxes must go ! Thanks for looking ! |
#3
|
|||
|
|||
![]()
Use Data Validation Lists for cells instead of checkbox controls. E.g. using "X" (or TRUE, or whatever) as a single list value, so user can't enter anything different.
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
14spar15 | Excel Programming | 2 | 05-18-2023 07:57 AM |
![]() |
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 |
![]() |
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 |