Move Rows in Excel (All Things You Need to Know)

Get FREE Advanced Excel Exercises with Solutions!

In this article, we will learn how to move contiguous and non-contiguous rows or columns by using the Excel features and formula.

The ability to move rows in Excel is a valuable skill that can enhance your data organization and analysis.

Efficiently moving rows allows you to reorganize data, sort information based on specific requirements, and transfer rows seamlessly between worksheets or workbooks. This level of control and flexibility enhances the accuracy and efficiency of your data-related tasks, saving you time and effort.

Move Rows in Excel

Download Practice Workbook

Download this practice workbook for practice while you are reading this article.


How to Move Rows in Excel

Here we will move rows or columns by using the Excel features and formula.

1. Using Keyboard Shortcuts

We’ll easily move rows using the keyboard shortcuts. Let’s follow the instructions below to learn!

Select rows that you want to move. Hence, press Ctrl + X to cut the rows.

2-Press Ctrl + X to Cut the rows

After that, press Ctrl + V to paste the rows to your desired location.

3-Using Ctrl + V to paste rows

Read More: How to Move Rows Up in Excel


2. Use Shift Key to Move a Row without Replacing

Select rows and place your cursor on the green borderline. As a result, the cursor turns into a four-directional arrow.

Now press and hold the Shift key to move the selected row to your desired location.

4-Press and hold the Shift key to move the selected row

  • The moving row is given in the below screenshot.

4-Press and hold the Shift key to move the selected row

To understand it, please have a look at the video below.

Read More: How to Move Rows Down in Excel


3. Move Row by Replacement

Here, we’ll learn how to move the entire row with replacement.

  • Select the entire row 13. Now, place your cursor on the selected row’s borderline.
  • As a result, the cursor turns into a four-directional arrow.
  • Now press and hold the Left key of the Mouse to move the selected row to your desired location.

10-Select Entire Row

  • Hence, a warning message pops >> Hit OK.

11-Press OK from the warning message

  • Finally, you will be able to move the entire row with a replacement of the row.

12-Move the entire row with replacement

Read More: How to Rearrange Rows in Excel


4. Applying Paste Options to Move Rows to Columns

To move rows to columns, select the cells B4:F16 >> Press Ctrl + C >> Select the B18 cell and press your right mouse button >> Choose the Transpose option from the context menu’s Paste Options: button.

7-Select Transpose Option from the Paste options

As a result, you will be able to move rows to columns.

8-Move Rows to Columns


5. Using Sort Feature

We’ll move rows by using the Sort command. To do that, add a new column by inserting a random number to the right side of the data table.

  • Select data range from G4 to G15 >> Go to Data tab >> Choose Sort command from the Sort & Filter group.
  • Hence, check the Expand the selection option >> press Sort.

13-Using Sort Command

  • Now, the Sort dialog box will appear >> Check the My data has headers option >> Select Column G in the Sort by drop-down list.
  • Choose the Smallest to Largest option from the Order drop-down list >> press OK.

14-Select Column G in the Sort by drop-down list

  • Here is the final output.

15-Sorting data from smallest to largest

Read More: How to Move Rows in Excel Without Replacing


6. Using Power Query Tool

Another way is to move the rows to columns in Excel by using the Excel Power Query tool.

  • Go to the Data tab >> Select From Table/Range feature from the Get & Transform Data group.
  • Choose the B4:F16 cells for table data from the Create Table window >> Press the OK button.

20-Selection of data range to create a table

  • As a result, the Power Query Editor window will appear.
  • Here, go to the Transform tab >> Use First Row as Headers tool >> Use First Row as Headers option >> Transpose tool.
  • After that, choose the Insert option.

21-Select the Transpose feature to move rows to columns

  • Further, you will see that the rows are moved into columns in the newly created table.

22-Moving Rows to Columns


How to Move Every Other Row to Column in Excel

We will use ISEVEN, ROW, and IF functions to move every other row to another column in Excel.

Type the following formula in cell G6.

=IF(ISEVEN(ROW(F6)),F6,"")

And again write down the similar formula in cell H6. Hence, AutoFill both formulas to the rest of the cells.

=IF(ISEVEN(ROW(F6)),"",F6)

23-Using ISEVEN, ROW, and IF functions to move every other row to another column


Transpose to Move Rows in Excel

1. Use TRANSPOSE Function

In cell B11, type the following TRANSPOSE function to move rows.

=TRANSPOSE(B4:F9)

9-Using TRANSPOSE function to move rows


2. Run an Excel VBA Code

Press Alt + F11 to pop up the Microsoft Visual Basic Applications window. Hence, select Module from the Insert tab to open a Module for inserting the VBA code.

  • Paste the below VBA code in that Module.
Sub Move_Rows_To_Columns()
	Dim MoveFrom As Range
	Dim MoveTo As Range
	Set MoveFrom = Application.InputBox(Prompt:="Select the Rows to Move", _
	Title:="Move Rows in Excel to Columns", Type:=8)
	Set MoveTo = Application.InputBox(Prompt:="Select the cell to insert the Moved Rows", _
	Title:="Move Rows in Excel to Columns", Type:=8)
	MoveFrom.Copy
	MoveTo.Select
	Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:=False, _
	Transpose:=True
	Application.CutCopyMode = False
End Sub

16-Pasting VBA code in the Module to move rows in Excel

  • Insert data range to move rows to columns.

17-Selection of the Rows to Move

  • Select a cell where you want to move the rows.

18-Selection of cell to insert moved rows

  • As a result, your selected rows would be moved in Excel to columns.

19-Move Rows to Columns in Excel


Things to Remember

  • When working with formulas, you have to be extra careful. Because after moving the rows to columns the formula reference would change too.
  • If you work with an Excel table, the transpose feature will not be available. In that case, you have to make the table a range and then move the rows to columns.
  • You can move only the non-contiguous rows or columns by applying the Sort feature.

Frequently Asked Questions

1. Can I move multiple rows at once in Excel?

A: Yes, you can move multiple rows at once in Excel. Simply select multiple rows by clicking and dragging the row numbers or by holding the Ctrl key while selecting individual rows. Then follow the same steps mentioned above to move the selected rows to a new location.

2. Can I move rows based on certain criteria in Excel?

A: Yes, you can move rows based on certain criteria in Excel by using sorting or filtering functionality. First, apply a filter to your data. Then, use the sorting feature to arrange the rows based on the desired criteria. After that, you can select and move the filtered rows to a new location.

3. How do I insert a row in Excel and move existing rows down?

A: To insert a row in Excel and move existing rows down, right-click on the row number where you want to insert the new row and select “Insert” from the context menu. Existing rows below the insertion point will automatically shift down.


Move Rows in Excel: Knowledge Hub


Conclusion

This article discusses the way we can move a row or rows in Excel. Moving rows in Excel is a vital skill that empowers you to streamline data management, analysis, and organization.

Excel provides multiple options, including drag and drop, cut and paste, and Power Query, to meet your preferences. Here, we present how you can move a single row, multiple rows, selected rows, alternate rows, rows based on cell content, based on specific cell content, filtered rows, and rows from the Excel table.


<< Go Back to Rows in Excel | Learn Excel

What is ExcelDemy?

ExcelDemy - Learn Excel & Get Excel Solutions Center provides online Excel training , Excel consultancy services , free Excel tutorials, free support , and free Excel Templates for Excel professionals and businesses. Feel free to contact us with your Excel problems.
Md. Abdur Rahim Rasel
Md. Abdur Rahim Rasel

MD. ABDUR RAHIM is a marine engineer proficient in Excel and passionate about programming with VBA. He views programming as an efficient means to save time while managing data, handling files, and engaging with the internet. His interests extend to Rhino3D, Maxsurf C++, AutoCAD, Deep Neural Networks, and Machine Learning, reflecting his versatile skill set. He earned a B.Sc in Naval Architecture & Marine Engineering from BUET, and now he has become a content developer, creating technical content... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo