Excel Quick Tips How to Flip Cells Switch Rows or Columns
Excel Quick Tips How to Flip Cells & Switch Rows or Columns
Dim vTop As Variant
Dim vEnd As Variant
Dim iStart As Integer
Dim iEnd As Integer
Application.ScreenUpdating = False
iStart = 1
iEnd = Selection.Columns.Count
Do While iStart < iEnd
vTop = Selection.Columns(iStart)
vEnd = Selection.Columns(iEnd)
Selection.Columns(iEnd) = vTop
Selection.Columns(iStart) = vEnd
iStart = iStart + 1
iEnd = iEnd - 1
Loop
Application.ScreenUpdating = True
End Sub VBA Macros are very useful but if you're not comfortable with them you can get results instantly using the data sorting trick. If VBA does pique your interest you can learn more about it with a .
MUO
Excel Quick Tips How to Flip Cells & Switch Rows or Columns
Use these strategies in Microsoft Excel to quickly flip rows, turn columns into rows, flip rows, and save a lot of wasted time! is a powerful program that can help you analyze and visualize data. To get the best results your data needs to be in the proper format. Occasionally you will run into data that is placed in a table, and you may not be able to work with the arrangement of rows and columns. Perhaps you have a column or row that you need to reverse entirely. Flipping cells in a row or column can be a lot of work to do manually. Instead of re-entering all your data you can use these strategies to flip columns, turn columns into rows, and flip rows.How to Flip Cells in Excel Columns
At first glance, there is no good way to flip columns upside down. Data sorting can sort by values or alphabetically but that doesn't invert a column in Excel. So what can you do? Copy the data and paste one by one? There's a much better way to get this done. Reversing the order of cells in a Microsoft Excel column is easy, and can be done in just a few steps with this nifty trick: Add a column to the left of the table you'd like to flip. Fill that column with numbers, starting with 1 and using the fill handle to create a series of numbers that ends at the bottom of your table. Select the columns and click Data > Sort. Select the column that you just added and filled with numbers. Select Largest to Smallest, and click OK. The columns are now inverted! This is a useful trick to add to your toolbox when you're . If you like working with Excel shortcuts you can perform this trick with one click. This shortcut can perform a quick sort by the leftmost column; Either by smallest-to-largest or largest-to-smallest. The real key to all this is the index column. Once you've got the data reversed you can delete the index column and you're ready to go. This trick was done on an Excel table but it works on any number of columns you want to invert. If you use , you can use this code to accomplish the same thing. Just select the column you want to flip and run this macro: Sub FlipColumns()Dim vTop As Variant
Dim vEnd As Variant
Dim iStart As Integer
Dim iEnd As Integer
Application.ScreenUpdating = False
iStart = 1
iEnd = Selection.Columns.Count
Do While iStart < iEnd
vTop = Selection.Columns(iStart)
vEnd = Selection.Columns(iEnd)
Selection.Columns(iEnd) = vTop
Selection.Columns(iStart) = vEnd
iStart = iStart + 1
iEnd = iEnd - 1
Loop
Application.ScreenUpdating = True
End Sub VBA Macros are very useful but if you're not comfortable with them you can get results instantly using the data sorting trick. If VBA does pique your interest you can learn more about it with a .