Tutor 5 (273 Reviews)
Excel Tutor
Still stuck with a Excel question
Ask this expertAnswer
To swap two adjacent rows, use drag-and-drop or cut-and-insert. Both keep formatting and formulas when done correctly.
-
Select the entire first row by clicking its row number at the left.
-
Move the mouse pointer to the row border until it becomes a four-headed arrow.
-
Press and hold the Shift key.
-
Click and drag the row up or down until a bold insertion bar appears between rows.
-
Release the mouse, then release Shift.
-
Verify that formulas and formatting moved with the row.
Alternative method using Cut and Insert:
-
Select the entire first row by clicking its row number.
-
Cut the row: press Ctrl+X on Windows or Command+X on Mac.
-
Right-click the row number where you want to insert the cut row.
-
Choose Insert Cut Cells from the context menu.
-
The cut row is inserted, and the other rows shift to make room.
How do I swap two non-adjacent rows?
To swap non-adjacent rows without losing data, use Cut and Insert for one row, then Cut and Insert for the other, or use a helper column and sorting to swap both at once.
Method 1 — two Cut & Insert operations:
-
Select and cut Row A (Ctrl+X / Command+X).
-
Right-click the row number below where Row B currently sits.
-
Choose Insert Cut Cells.
-
Select and cut the original Row B (now shifted).
-
Right-click the old position of Row A and choose Insert Cut Cells.
-
Confirm positions and formula integrity.
Method 2 — helper column and sort (non-destructive, safe for many rows):
-
Insert a new helper column at the far left.
-
Fill the helper column with sequential numbers (1, 2, 3, ...).
-
Change the helper numbers for the two rows you want to swap so they swap values (for example, change 3→7 and 7→3).
-
Select the full table, including the helper column.
-
Use Data → Sort by the helper column, smallest to largest.
-
Delete the helper column if no longer needed.
How do I swap multiple rows or a block of rows?
To swap blocks of rows, use Cut & Insert or a helper column + sort for large sets.
-
Select the entire block (click first row number, then Shift+click last row number).
-
Cut the block (Ctrl+X / Command+X).
-
Right-click the destination row number.
-
Choose Insert Cut Cells.
-
Use helper-column sorting when you must reorder many blocks at once.
What happens to formulas and references when I swap rows?
Formulas update automatically when rows move, but relative references may change in ways you do not want.
-
Formulas referencing the moved cells maintain links when rows are moved as whole rows.
-
Relative references inside formulas adjust based on new cell positions.
-
Use absolute references (e.g.,
$A$1) when you need a formula to keep pointing to the exact cell. -
Use Paste Special → Formulas when copying formulas without moving dependent cell values.
-
Use helper-column sorting when you need formulas to stay tied to their original rows while reordering.
Which method is safest when working with large sheets and many formulas?
Helper-column sorting is safest for large datasets because it reorders without cutting and reinserting, which minimizes accidental overwrites.
-
Add a helper column with current order numbers.
-
Modify the helper numbers to reflect desired order.
-
Sort the entire dataset by the helper column.
-
Delete the helper column when done.
Can I use a keyboard shortcut to swap rows quickly?
Yes, cutting and inserting has common shortcuts; the Insert Cut Cells action is done via the context menu or ribbon.
-
Cut selected row: Windows:
Ctrl+X. Mac:Command+X. -
Open context menu by right-clicking the row header and choose Insert Cut Cells.
-
Paste normally with
Ctrl+V/Command+Vwhen appropriate. -
No single built-in universal shortcut exists for “Insert Cut Cells” across every Excel version; use the menu or right-click.
What differences exist between Windows and Mac for these operations?
Most features are the same. Main differences are keyboard keys and sometimes the menu layout.
-
Cut and paste keys: Windows:
Ctrl+X/Ctrl+V. Mac:Command+X/Command+V. -
Right-click context menus provide Insert Cut Cells on both platforms, though the exact menu text can vary by Excel version.
-
Ribbon layout may differ slightly on Mac; use Home → Insert or right-click row header to access insert options.
-
Drag-and-drop behavior with Shift works similarly on both platforms.
How to undo a mistaken swap?
To revert immediately, use Undo.
-
Press
Ctrl+Zon Windows orCommand+Zon Mac. -
Repeat undo until the sheet returns to the desired state.
-
Use File → Save As to create a backup before large reorders when working on critical data.
When should I use a VBA macro to swap rows?
Use VBA for frequent or bulk swaps, or when needing to swap rows programmatically.
-
Open the Visual Basic Editor (Alt+F11 on Windows; Option+F11 or Developer menu on Mac).
-
Insert a new Module.
-
Add a macro that swaps rows by reading and writing entire row ranges.
-
Run the macro to execute swaps reliably and repeatedly.
Example VBA macro to swap two rows (copy-paste into the VBA editor)
-
Open the VBA editor.
-
Insert a module and paste the macro below.
-
Change
r1andr2to the row numbers to swap. -
Run the macro.
Sub SwapRows()
Dim r1 As Long, r2 As Long
Dim tmp As Variant
r1 = 2 ' set first row number to swap
r2 = 5 ' set second row number to swap
tmp = Rows(r1).Value
Rows(r1).Value = Rows(r2).Value
Rows(r2).Value = tmp
End Sub
What best practices prevent errors when swapping rows?
-
Save a copy of your workbook before large edits.
-
Use helper-column sorting for large reorders.
-
Check formulas after swaps, especially those using relative references.
-
Turn on Show Formulas to inspect formula cells when worried about references.
-
Use named ranges for critical references to reduce errors from row moves.
How do I swap rows while preserving formatting exactly?
To preserve formats, move whole rows (not copy/paste values).
-
Select full rows by clicking row numbers.
-
Use Cut and Insert Cut Cells, which moves cells with their formats.
-
Confirm conditional formatting rules still apply correctly after the move.
Get Online Tutoring or Questions answered by Experts.
You can post a question for a tutor or set up a tutoring session
Answers · 1
How to remove date format in excel
Answers · 1
What is short date format in excel
Answers · 1
How to stop excel from changing date format
Answers · 1
How to convert text to date in excel
Answers · 1