8 Ways to Move a Row in Microsoft Excel

You’re reorganizing data sets, restructuring tables, or simply adjusting the layout, you often need to move rows in your worksheet up and down or right and left. If you know how to move a row in Excel, such tasks become effortless.

Microsoft Excel doesn’t offer any dedicated ribbon commands to move rows the way you want. You must use a combination of keyboard shortcuts, mouse movements, and indirect ribbon commands to achieve this feat.

Read this article until the end to discover multiple ways to move a row so you can choose a method that suits your worksheet and its datasets. Let’s begin!

Move a Row Using a Drag and Drop Movement

This is the easiest way to move a row in any direction, like up, down, right, and left.

Row movement icon
Row movement icon

Highlight the target row by selecting the exact number of cells containing data. This is beneficial if you wish to avoid replacing other cell ranges in a different table of the same row.

You shall see a thick green border around the selected cell range. Hover the mouse cursor over the thick border to activate the row movement cursor. It’s the cursor with four arrows pointing outwards.

Moving row using drag and drop
Moving row using drag and drop

You can now drag the mouse to the left, right, up, and down to move the row where you want. When dragging, you shall see a silhouette of the dragged cell range.

When moving, you shall also see the new cell range address for the data after the moving is complete.

Moved a row in Excel using drag
Moved a row in Excel using drag

Let go of the mouse click to place the cell range on its destination.

Overlapping with data
Overlapping with data

If data already exists in the destination cell range where you’re moving a row of data, Excel shall ask you to confirm whether you want to replace the data or not.

Replaced existing data by moving a row
Replaced existing data by moving a row

If you choose OK, the old data shall be updated with the data from the row you’re moving.

Contrarily, if you choose Cancel, the row movement shall be aborted by Excel.

Moving entire row only allows up and down movements
Moving an entire row only allows up and down movements

Suppose, you want to move the entire row by selecting all the cells between columns A and XFD, you can follow the same drag-and-drop movement as explained above.

However, in this scenario, you won’t be able to move the row to the left or right. Only up and down movements are allowed when moving the entire row in Excel.

📒 Read More: How Many Rows Can Excel Handle?

Using Shift + Drag

If you wish to manually place a row between two rows in an Excel dataset or table, you can use this method.

Moving a row in between rows
Moving a row in between rows

Highlight the target cell range or row on your worksheet.

Press the Shift key on the keyboard.

Now, activate the movement cursor by following the steps mentioned earlier.

Start dragging the row or cell range up, down, left, or right to relocate it.

You shall see a thick border between two contiguous rows in the worksheet.

If you’ve found the destination, let go of the mouse click and the Shift key.

Move a Row in Excel Using the Ctrl Key

This is the fastest way to move a row.

Row movement icon with Ctrl
Row movement icon with Ctrl

Simply highlight the row you want to move and press the Ctrl key.

Now, hover the mouse cursor over the up or down border of the row to activate the moving icon.

Move row using Ctrl
Move row using Ctrl

If you’ve selected a cell range within a row, you can move the selection left, right, up, and down.

Moving entire row up down using Ctrl key
Moving the entire row up and down using the Ctrl key

Contrarily, if you’ve selected the entire row, you can only move it up or down.

Move row using Ctrl
Move row using Ctrl

Go to the destination row and release the mouse click to place the selected row.

Created a copy of the moved row
Created a copy of the moved row

If you place the cell range on a row where data already exists, Excel shall replace the old dataset without showing a warning message.

When you move a row using this method, you create a copy of the selected row.

Move a Row in Excel Using Copy and Paste

Copy and paste to move rows
Copy and paste to move rows

You can simply highlight the row or a cell range from the row and press Ctrl + C to copy the content.

Then, go to the destination row and press Ctrl + V to move the row there. If the destination cell range has any old data, Excel shall update that without any prompt.

However, this method is beneficial in another way. Suppose, you’d like to move 5 non-contiguous rows from a table into another table or cell range in a contiguous manner. You can do so by using this method.

Select noncontiguous rows
Select non-contiguous rows

Select the target rows in the source table. Since these rows are non-contiguous, you must press the Ctrl key.

Move non-contiguous rows continuously
Move non-contiguous rows continuously

Now, go to the destination cell range and press Ctrl + V to move the rows in continuation.

Move a Row in Excel Using Insert Cut Cells

If you wish to change the position of rows in a table or cell range to organize your dataset in a better way, you can use this method.

Move 2nd row to 8th row
Move 2nd row to 8th row

In the above dataset, I need to move the 2nd row above the 8th row without changing the values of the dataset or deleting a row.

So, I’d select the target row and press Ctrl + X.

Then, I’d select the 8th row in the dataset and right-click to bring up the context menu. There, I select the Insert Cut Cells function.

Moved row using Insert Cut cells
Moved row using Insert Cut cells

Excel shall move the 7th row to the 6th position and replace the blank space of the 7th row with the 2nd row.

You can also follow this method to move multiple contiguous rows to a different position in the table.

However, this technique won’t work on multiple non-contiguous cells.

Move a Row in Excel Using a Sort Criteria

The Sort & Filter tool also allows you to move rows up or down using sorting criteria. If your sort by cells contains text strings, then the sorting criteria available to you are A to Z and Z to A.

Alternatively, if the sort by column contains numerical values, you can apply sorting criteria like Smallest to Largest and Largest to Smallest.

Sample dataset
Sample dataset

Suppose, in the above dataset, you want to move the candidate’s row containing the heights score to the top, then 2nd, 3rd, and so on.

Activate Sort & Filter
Activate Sort & Filter

Select the column header text and press Ctrl + Shift + L to activate the Sort & Filter tool.

Sort largest to smallest
Sort largest to smallest

Now, click the drop-down arrow for the sorting criteria and choose the Smallest to Largest option.

Moved rows in Excel using Sort & Filter
Moved rows in Excel using Sort & Filter

Excel shall quickly re-arrange the table from the largest value to the smallest value in the Score column.

Move a Row in Excel Using the SORT Function

Another smart way to move rows up or down is by using the Excel SORT formula.

Stock price dataset
Stock price dataset

Suppose, you’d like to move the row that contains the highest stock price to the top of the table. Then, you want the stock scoring the 2nd highest price, and so on.

Enter SORT function
Enter SORT function

You can select the cell C2 and enter the following formula:

=SORT(A2:B6,2,-1)

Press Enter to apply the formula to sort the input dataset in an array of data. If you’re using any Excel desktop app below Excel for Microsoft 365, you must press Ctrl + Shift + Enter.

In the above formula, the cell range represents the data table you’re sorting. So, adjust this according to your own worksheet.

Then, you must enter the column number by which you want to sort the input dataset. In this example, it’s the Score column, which is number 2 in the table.

The value -1 in the formula tells Excel to sort the dataset in descending order. If you want this to be in ascending order, input 1.

Using SORT function to move rows up and down
Using the SORT function to move rows up and down

Under columns C and D, you shall get the sorted dataset.

The dataset shall change dynamically if you change the input values.

Copying and pasting array data as values
Copying and pasting array data as values

To preserve the values only, copy the array dataset using Ctrl + C.

Go to the destination cell range, press Ctrl + Alt + V, and choose Values inside the Paste section of the Paste Special dialog.

Delete columns
Delete columns

Finally, delete columns C and D to complete the process of moving rows up and down by values.

Move a Row in Excel Using Excel VBA

If you wish to programmatically move one or many rows in an Excel dataset with visual queues, you can use Excel VBA. Here’s the script you can use:

VBA script to move rows
VBA script to move rows
Sub MoveRows()
    Dim rng As Range
    Dim destRow As Long
    Dim ws As Worksheet

    ' Set the worksheet
    Set ws = ActiveSheet

    ' Prompt the user to select rows
    On Error Resume Next
    Set rng = Application.InputBox("Select rows to move", Type:=8)
    On Error GoTo 0

    ' Check if the user canceled the operation
    If rng Is Nothing Then Exit Sub

    ' Prompt the user to enter the destination row number
    destRow = Application.InputBox("Enter the row number where you want to move the selected rows", Type:=1)

    ' Check if the user canceled the operation
    If destRow = 0 Then Exit Sub

    ' Move the rows
    rng.Cut Destination:=ws.Cells(destRow, 1)

    MsgBox "Rows moved successfully!", vbInformation
End Sub

Find out how to create a VBA macro by checking out the following Excel tutorial:

📒 Read More: How To Use The VBA Code You Find Online

Macro dialog
Macro dialog

Now that you’ve successfully created a VBA macro, press Alt + F8 to access the Macro dialog. There, select the MoveRows macro and hit the Run button.

Input target rows
Input target rows

When an input box shows up, enter the row numbers or cell ranges you want to move. You can use commas between two rows or cell range addresses to move multiple rows.

Input destination
Input destination

In the next prompt, enter the row number or address where you want to move these rows or cell ranges.

Moved rows using VBA
Moved rows using VBA

If you provide the input values correctly, Excel shall automatically move the rows you’ve selected.

Move a Row in Excel Mobile App

Just like the Excel desktop app, there aren’t any straightforward commands in the Excel ribbon menu to move rows. You need to perform a drag-and-drop movement to move rows wherever you want.

Open worksheet in Excel iOS
Open worksheet in Excel iOS

Firstly, open your Excel worksheet in the Excel mobile app.

Now, select the row or cell range of a row that you want to move anywhere on the worksheet.

Move row in Excel iOS
Move row in Excel iOS

Longpress on the selected row to activate the row movement action.

Drag the row to the destination cell range to move the cell range.

If there is old data in the destination cell range, Excel shall ask you whether you want to replace the data or not.

If you’re using the Excel mobile app on an Android smartphone, you can follow the same steps to move a row.

Conclusions

If you’ve made it here, you’ve learned 9 different methods to move a row in Excel. You can try out the method that suits your Excel expertise level and according to the exact problem you’re solving in your worksheet.

Among all the techniques that involve manual movements and functions, the best solution is using the Excel VBA method. It guides you through the entire row-moving process with input boxes so that you can achieve the best results.

If the article helped you, you can share your feedback here. Contrarily, if you know a different method to move a row, mention that in your comment.

About the Author

Tamal Das

Tamal Das

I'm a freelance writer at HowToExcel.org. After completing my MS in Science, I joined reputed IT consultancy companies to acquire hands-on knowledge of data analysis and data visualization techniques as a business analyst. Now, I'm a professional freelance content writer for everything Excel and its advanced support tools, like Power Pivot, Power Query, Office Scripts, and Excel VBA. I published many tutorials and how-to articles on Excel for sites like MakeUseOf, AddictiveTips, OnSheets, Technipages, and AppleToolBox. In weekends, I perform in-depth web search to learn the latest tricks and tips of Excel so I can write on these in the weekdays!

Subscribe

Subscribe for awesome Microsoft Excel videos 😃

Related Posts

Comments

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Get the Latest Microsoft Excel Tips

Follow Us

Follow us to stay up to date with the latest in Microsoft Excel!

Subscribe for awesome Microsoft Excel videos 😃