Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to make data upside down with a single click in MS Excel 2007 like shown in the below picture?

enter image description here

after making upside down

enter image description here

As well how to reverse it back with a single click?

share|improve this question

I don't think Excel can do this on its own, but I found this macro

Sub FlipRows()
    Dim vTop As Variant
    Dim vEnd As Variant
    Dim iStart As Integer
    Dim iEnd As Integer
        Application.ScreenUpdating = False
        iStart = 1
        iEnd = Selection.Rows.Count
        Do While iStart < iEnd
            vTop = Selection.Rows(iStart)
            vEnd = Selection.Rows(iEnd)
            Selection.Rows(iEnd) = vTop
            Selection.Rows(iStart) = vEnd
            iStart = iStart + 1
            iEnd = iEnd - 1
        Application.ScreenUpdating = True
End Sub


share|improve this answer
Note that the entire table needs to be selected before running this macro. – Excellll Dec 27 '11 at 5:31

If you do want to do it with "clicks" only, then you need VBA, and this question is better asked on Stack Overflow

You can do this with an array formula (ie without VBA)

See Pearson's Reversing The Order Of A List

If your data was in A1:C3 then

  • Select E1:G3
  • put this formula in the formula bar =OFFSET(A$1:A$3,MAX(ROW($D$1:$D$3))-ROW(),0)
  • hit Shift Ctrl & Enter together to enter this as an array formula

enter image description here

share|improve this answer

Try adding numbering to a column to the right of the data, like this:

Raju  100   34   1
Ravi  234   45   2
kavi  232   32   3

Select the data, then do a descending sort by the 4th column.

Then feel free to delete the fourth column.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .