Excel move selected rows to new sheet
There are a few ways to move selected rows to a new sheet in Excel. Here are a few methods:
Method 1: Using the "Move" feature
- Select the rows you want to move by checking the boxes in the row headers.
- Go to the "Home" tab in the ribbon.
- Click on the "Move" button in the "Cells" group.
- Select "Move to a new sheet" from the dropdown menu.
- Choose a new sheet name and location from the "Move to" dropdown menu.
- Click "OK" to move the selected rows to the new sheet.
Method 2: Using the "Copy" and "Paste" features
- Select the rows you want to move by checking the boxes in the row headers.
- Go to the "Home" tab in the ribbon.
- Click on the "Copy" button in the "Clipboard" group.
- Go to the new sheet where you want to move the rows.
- Right-click on the row header where you want to insert the rows.
- Select "Paste" from the context menu.
- Choose "Paste values" or "Paste formulas" depending on your needs.
Method 3: Using VBA code
- Open the Visual Basic Editor by pressing "Alt + F11" or by navigating to "Developer" tab in the ribbon.
- In the Editor, click on "Insert" > "Module" to insert a new module.
- Paste the following code:
Sub MoveSelectedRowsToNewSheet() Dim selectedRows As Range Set selectedRows = Selection Dim newSheet As Worksheet Set newSheet = Worksheets.Add selectedRows.Copy newSheet.Range("A1").Paste Application.CutCopyMode = False End Sub
- Save the module by clicking "File" > "Save" (or press "Ctrl + S").
- Go back to your Excel worksheet and select the rows you want to move.
- Press "Alt + F8" to open the Macro dialog box.
- Select the "MoveSelectedRowsToNewSheet" macro and click "Run".
Note: The above code will move the selected rows to a new sheet at the end of the workbook. If you want to move the rows to a specific location in the new sheet, you can modify the code accordingly.