Move an Excel Row to Another Sheet When a Check Box Is Checked
Question details
Move a row to another worksheet when its check box is selected.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A workbook has a check box on each row, and selected rows need to be transferred to a destination worksheet.
- Observed behavior
- Checking a row's check box should transfer the corresponding row to the destination sheet.
Open the workbook in a desktop version of Excel that supports VBA and save it as an Excel Macro-Enabled Workbook (.xlsm). For the example below, create sheets named Source and Destination, put headers in row 1, and ensure column A contains a value for every data row.
Copy checked rows using Form Control check boxes and VBA
Use a linked cell to identify each checked row and a macro to copy its data to the next available destination row.
This example copies columns A through E as values. It leaves the source row in place and does not transfer formatting or formulas. Checking the same box again after clearing it will create another copy.
Use Form Control check boxes for these steps, not ActiveX controls or the newer in-cell check boxes.
On Source, choose Developer > Insert > Check Box under Form Controls. Place a check box on each data row. Right-click each box, choose Format Control > Control, and set its Cell link to a unique cell on the same row, such as $F$2 for row 2 and $F$3 for row 3.
Open Developer > Visual Basic, choose Insert > Module, and paste this code: Sub CopyCheckedRow() Dim src As Worksheet, dst As Worksheet Dim cb As CheckBox Dim sourceRow As Long, nextRow As Long Set src = ThisWorkbook.Worksheets("Source") Set dst = ThisWorkbook.Worksheets("Destination") Set cb = src.CheckBoxes(Application.Caller) If cb.Value <> xlOn Then Exit Sub If cb.LinkedCell = "" Then MsgBox "Link this check box to a cell on its row first." Exit Sub End If sourceRow = src.Range(cb.LinkedCell).Row nextRow = dst.Cells(dst.Rows.Count, "A").End(xlUp).Row + 1 dst.Cells(nextRow, "A").Resize(1, 5).Value = _ src.Cells(sourceRow, "A").Resize(1, 5).Value End Sub
Return to Source, right-click each Form Control check box, choose Assign Macro, select CopyCheckedRow, and click OK.
Save the workbook, enable macros if Excel prompts you, and check a box on Source. Open Destination and verify that columns A through E appear on the next row.

Work with Excel spreadsheets in WPS Office
WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and support for common Excel formats, making it easy to migrate everyday workbook editing. It does not fix Excel's VBA behavior, and macro compatibility depends on the WPS edition and environment.

Frequently Asked Questions
Can a check box move a row without VBA?
A check box alone does not transfer a row. It can update a linked cell, but an automation method such as VBA is needed to copy or remove the row when the box is checked.
Do the check boxes have to be ActiveX controls?
No. Form Control check boxes can run the example macro when you right-click each box and select Assign Macro. ActiveX controls use a different event-based setup.
Why did the macro copy the wrong row?
Check the box's linked cell under Format Control > Control. Each box must link to a unique cell on its own source row, such as $F$2 for the box on row 2.
How do I keep the macro when I save the workbook?
Choose File > Save As and select Excel Macro-Enabled Workbook (*.xlsm). A standard XLSX file cannot retain VBA macros.




