Excel Checkbox - How do i duplicate entire row when checkbox is ticked?

ozc1han

New Member
Joined
Jun 11, 2020
Messages
19
Office Version
  1. 2016
Platform
  1. Windows
Hi all,

I've always found my answers to excel questions on mrexcel, however, at the moment I'm struggling! I'm not that experienced with Excel.

I have made a checklist with Check Boxes (Form Control), which is linked to the column beside it. When checked, TRUE appears in the column beside the checkbox and the checkbox highlights the row so it is clearly selected.

When checked I need the row to be duplicated (into another sheet [sheet 2]). When unchecked from sheet 2, I need to row be removed. Sheet 2 is basically going to be where I'd like all checked items from different sheets to appear.
If the row can't be duplicated, I would like it to be moved (into another sheet [sheet 2]).

Any help will be highly appreciated!

Thank you :)
 

Attachments

  • Capture.JPG
    Capture.JPG
    185.6 KB · Views: 30
You are welcome. Just curious ... which version did you decide to use ?
 
Upvote 0

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
The second version (checklist 02). I couldn't get the first version to work. When I double-clicked column d, nothing would happen. I can post a screen recording if it helps. But checklist 02 does the job!
I just need to figure out how to add the other tabs but I'll play around a bit and should be able to figure it out :) Thank you so much!
 
Upvote 0
Yes, the corrected version works perfectly too. The headings and subheadings make it look fantastic!
 
Upvote 0
I was concerned that Version 1 would not be "clean" enough in the presentation. Maybe another way of defining it is
"too busy" with all the section headers.

My preference is Version 2. Lots cleaner and neat.
 
Upvote 0
I agree!
In the sections where I do not need to highlight anything, the section headers don't need to be there. I think I'll end up using version 2.

Thanks Logit, you're a legend!
 
Upvote 0
Thanks for all the help! I've been using the check and it's working perfectly. I would like to know if there is a way to uncheck all the checkmarks at once? I've renamed the sheets and the details are below.

-----------------------

Option Explicit

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

If Not Intersect(Target, Range("C4:C617")) Is Nothing Then
Application.EnableEvents = False

If ActiveCell.Value = ChrW(&H2713) Then
ActiveCell.ClearContents
ActiveCell.EntireRow.Interior.Color = xlNone
Else
ActiveCell.Value = ChrW(&H2713)
ActiveCell.EntireRow.Interior.ColorIndex = 36
End If
Application.ScreenUpdating = True

Cancel = True

End If

Application.EnableEvents = True

Copy_n_Paste

End Sub


Sub Copy_n_Paste()
On Error Resume Next

Dim srchtrm As String
Dim rng As Range, destRow As Long
Dim shtSrc As Worksheet, shtDest As Worksheet
Dim c As Range
Dim i As Integer
Dim Today As Date

With Application
.ScreenUpdating = False
.DisplayStatusBar = False
.Calculation = xlCalculationManual
.EnableEvents = False
End With

Sheet11.Rows("2:140").Delete

Set shtSrc = Sheets("Checklist") 'source sheet
Set shtDest = Sheets("Inspection Report") 'destination sheet
destRow = 2 'start copying to this row

'don't scan the entire column...
Set rng = Application.Intersect(shtSrc.Range("C:C"), shtSrc.UsedRange)

For Each c In rng.Cells
If c.Value = ChrW(&H2713) Then

c.EntireRow.Copy shtDest.Cells(destRow, 1)

destRow = destRow + 1

End If
Next

Sheet11.Columns("A:H").EntireColumn.AutoFit

Worksheets("Inspection Report").Range("A:A").ColumnWidth = 10
Worksheets("Inspection Report").Range("B:B,D:D").ColumnWidth = 15
Worksheets("Inspection Report").Range("C:C").ColumnWidth = 3.5
Worksheets("Inspection Report").Range("E:E,F:F").ColumnWidth = 4.5
Worksheets("Inspection Report").Range("G:G").ColumnWidth = 35
Worksheets("Inspection Report").Range("H:H").ColumnWidth = 35
Sheet11.Rows("2:140").RowHeight = 150


With Application
.ScreenUpdating = True
.DisplayStatusBar = True
.Calculation = xlCalculationAutomatic
.EnableEvents = True
End With

Application.CutCopyMode = False
Sheets("Operations - Data").Range("A1").Select

End Sub

------------------------
 
Upvote 0
VBA Code:
Sub ClrCol()
Dim ws As Worksheet
Set ws = Sheets("Checklist")
Application.ScreenUpdating = False
   Dim c As Range
        For Each c In ws.UsedRange.Columns("D").Cells
            If c.Value = ChrW(&H2713) Then
                c.ClearContents
                c.EntireRow.Interior.Color = xlNone
            End If
        Next c
Application.ScreenUpdating = True
    Copy_n_Paste
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top