How To Swap Cells in Excel [Easy 1 Minute Guide]

How to swap cells in Excel? In short, all you have to do to swap the adjacent cells in Excel is select the first cell, hold shift, and drag from the edge to the end of the next cell when the bracket icon pops up.

If you need a more detailed guide with screenshots or want to learn how to swap cells in Excel in the workbook, keep reading to learn more.

How To Swap Cells in Excel

There are multiple ways I often use the Excel swap cells feature. Let’s take a look at some of these methods below.

How To Swap Two Cells in Excel by Clicking and Dragging

In my opinion, the clicking and ragging method is the most efficient way to switch cells. Below is a detailed on how to switch two cells in Excel:

How to swap cells in Excel—example template
  1. Select the cell that you want to swap.
    • I want to drag the cell with the text “Gill” out of the column.
How to swap cells in Excel—moving the cell B5
  1. Press and hold the Shift button on the keyboard.
    • Move the mouse icon to the cell’s border on the right side of the spreadsheet until the cursor changes from a white plus sign to a black arrow plus icon.
  2. Click and drag the cell out of its original position.
    • You will see a bracket-like icon at the border of the nearest cell.
  3. Keep dragging it until you align the mouse with the wall at the far end of the cell that you want to swap.
  4. Now, release the left mouse button to switch the cells.

The cell value that I dragged will be moved to the location of the bracket.

One thing to note is that if you drag the cell between two already populated cells, an extra space will be created between the two, with the cell’s value moving to the side. If I moved the cell to any neighboring cells, the values would be swapped between the two.

Watch Our Video To Swap Cells in Excel

Here’s a short video tutorial to teach you how to swap cells in Excel. Enjoy!

[adthrive-in-post-video-player video-id=”Gb4SZb9y” upload-date=”2023-11-13T12:33:36.000Z” name=”How to Swap Cells in Excel” description=”Want to swap cells in Excel? Here’s the fastest way to do it. For a more detailed explanation, check out my guide on swapping cells in Excel.” player-type=”default” override-embed=”default”]

Use VBA Code to Swap Two Cells in Excel

Excel VBA is a development environment that allows its users to create and automate tasks within Excel. This also allows you to create a script to swap cells by pressing a button.

Here is how to swap cells using the VBA code:

  1. Select the cell that you want to swap.
  2. From your keyboard, press the Alt + F11 keys.
    • For laptops, you may have to press the Alt + fn + F11 keys, depending on whether you have enabled the secondary function.
    • This will open the “Visual Basic for Applications” window.
Microsoft's Visual Basic for Applications window.
  1. Click the “Insert” option in the top bar of the window.
  2. Choose the “Module” option. In the pop-up window, copy and paste this code:
Sub SwapTwoRange()

'Updateby20131120

Dim Rng1 As Range, Rng2 As Range

Dim arr1 As Variant, arr2 As Variant

xTitleId = "KutoolsforExcel"

Set Rng1 = Application.Selection

Set Rng1 = Application.InputBox("Range1:", xTitleId, Rng1.Address, Type:=8)

Set Rng2 = Application.InputBox("Range2:", xTitleId, Type:=8)

Application.ScreenUpdating = False

arr1 = Rng1.Value

arr2 = Rng2.Value

Rng1.Value = arr2

Rng2.Value = arr1

Application.ScreenUpdating = True

End Sub

This code was taken from Indeed.com.

Swap module code
  1. Click on the green “Run” button in the main toolbar.

When the code runs, you will be prompted to enter the address for the first value. Input the cell address and press “Enter.” You will then be prompted to input the second cell address. Input the address and press “Enter,” the cells should then be swapped.

Want to learn more about using VBA? Check out these top Excel VBA courses on Udemy to upskill today.

Related: Google Sheets vs. Excel – Which Is Better In 2024?

What Does Swapping Cells in Excel Mean?

In Excel, swapping cells means changing the values of any two cells to the opposing cell’s value. Cells with text, formulas, and numbers can be swapped.

The Excel swap cells functionality may also include formatting components like fonts and background colors. While manually switching the cells by retyping, copying, and pasting the numbers is an option, other ways to swap the cells can help you work more quickly and efficiently.

Related: A Simple Tutorial to the Google Sheet TRANSPOSE Function

When Should You Swap Cells in Excel?

If you need to add a large amount of data to your Excel worksheet but decide it would look better visually if the cells were swapped. An option I like to use is correcting the errors for accuracy’s sake.

Swapping cells can also save time by preventing the need to retype data.

Related: How To Convert Excel to Google Sheets

How To Swap Cells in Excel: Extra Tips

Now that we have looked at how to swap cells in Excel let’s look at a few tips for switching cells in Microsoft Excel.

Swapping Adjacent Columns or Rows

The same procedure used to swap adjacent cells in Excel can also be used to switch rows and columns. Just select the row or column headers instead of individual cells.

This will also work with adjacent ranges. Just select the entire range instead of individual cells.

Swapping Cell Ranges From Anywhere in the Worksheet

You can use the VBA method or add-ons like KuTools to swap entire ranges instead of individual cells. Just make sure you use absolute values when entering the ranges.

Related: 11 Best Excel Courses Online in 2024

Frequently Asked Questions

How Can I Quickly Swap Two Adjacent Cells in Excel?

Follow the steps below to swap the contents of two adjacent cells:

  1. Click to select the cell and hold Shift on your keyboard.
  2. Move your cursor to either side of the cell box.
  3. Click and drag the cell’s contents to the far end edge of the cell with which you want to swap the contents.
  4. Now, let go of the cursor to swap the two cells.

Is There a Shortcut to Swap Cells Excel?

Yes, and it’s super simple to use! Just follow the steps below:

  1. Select the cell you want to swap and press the Ctrl + X keyboard shortcut.
  2. This will cut out the contents of the cell.
  3. Click the Ctrl + Shift + = keyboard shortcut to swap the cell’s contents.

Wrapping Up

Now you know how to swap cells in Excel in every way. While swapping adjacent cells is easy, using VBA code to swap further apart ranges is a little more complex. Hopefully, Microsoft will make it a little easier in the future.

If you found this article helpful and would like to support our site, consider checking out our premium template library to streamline your life. Remember to use the code SSP to save 50%.

Get Premium Templates

Related:

Most Popular Posts

Related Posts

Thanks for visiting! We’re happy to answer your spreadsheet questions. We specialize in formulas for Google Sheets, our own spreadsheet templates, and time-saving Excel tips.

Note that we’re supported by our audience. When you purchase through links on our site, we may earn commission at no extra cost to you.

Like what we do? Share this article!