ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   reverse or flip rows (https://www.excelbanter.com/excel-programming/395320-reverse-flip-rows.html)

[email protected][_2_]

reverse or flip rows
 
I have data that looks like this:
123 456 789
avb yu3 111

I need to flip this arrangement so that I get:
avb yu3 111
123 456 789

I might I programatically achieve this result

Mary


Excel_Expert

reverse or flip rows
 
On Aug 12, 4:35 pm, "
wrote:
I have data that looks like this:
123 456 789
avb yu3 111

I need to flip this arrangement so that I get:
avb yu3 111
123 456 789

I might I programatically achieve this result

Mary


That would depend. You can, of course, achieve the result
programmatically. However through excel what you could do is
1. Add a new column and insert serial numbers
2. Sort the data range based on this column -- descending. You should
have the flipped results


David Hilberg

reverse or flip rows
 
You can do this with keyboard and mouse. It's easier done than said:

1. Highlight one of the rows by clicking its row number.
2. Pass your mouse over the upper or lower border of the highlighted
row until the cursor changes. It doesn't matter which border.
3. While pressing Shift, drag the border across the other row, just to
the other side.
4. Release mouse button.
5. Release shift key.


If your rows are always the same (here, row 10 and 11), a recorded
macro will give you:

Sub SwapRows()
Rows("11:11").Select
Selection.Cut
Rows("10:10").Select
Selection.Insert Shift:=xlDown
End Sub


If your rows are not always the same, highlight the upper row and run
this macro:

Sub SwapUpperRowWithLower()
Selection.Cut
ActiveCell.Offset(2, 0).Rows("1:1").EntireRow.Select
Selection.Insert Shift:=xlDown
End Sub


Hope this helps,
- David



On Aug 12, 7:35 am, "
wrote:
I have data that looks like this:
123 456 789
avb yu3 111

I need to flip this arrangement so that I get:
avb yu3 111
123 456 789

I might I programatically achieve this result

Mary





All times are GMT +1. The time now is 06:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com