VBA & Macro Problems

Move an Excel Row to Another Sheet When a Check Box Is Checked

Emma BrownEmma Brown Dec 2, 2026 869 views

Question details

Move a row to another worksheet when its check box is selected.

Move an Excel Row to Another Sheet When a Check Box Is Checked
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.
Before you start

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.

Solution 1Recommended

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.

1
Add and link the 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.

2
Add the macro

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

3
Assign the macro

Return to Source, right-click each Form Control check box, choose Assign Macro, select CopyCheckedRow, and click OK.

4
Test the transfer

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.

Copy checked rows using Form Control check boxes and VBA
Copying versus moving: The example copies rather than deletes the source row. To create a true move, the macro needs additional logic to remove the source row and manage its check box and linked cells; test that logic carefully before using it on a live workbook.
Free Microsoft Office alternative

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.

Edit and organize worksheet rows in WPS SpreadsheetsOpen and save common Microsoft Excel formats such as XLSXUse a familiar interface for everyday spreadsheet tasksChoose a free, lightweight office suite
microsoft office alternative - wps office

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.