Flip Flop

abacon1960

Board Regular
Joined
Jul 28, 2014
Messages
52
I have a set of data listed from AZ2 all the way to AZ556.

EXAMPLE.

1675
4578
5689
1256
4456
5568
etc.

I want to flip the data so the column will now read. This will allow me to align it with the correct dates that are set in stone on the spreadsheet. The dates are set in reverse order of the data I am importing. The dates need to remain as they ARE.

5568
4456
1256
5689
4578
1675

Is this possible?
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

igold

Well-known Member
Joined
Jul 8, 2014
Messages
2,859
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Does this do what you want...

Code:
Sub Flip()


    Dim fLop, i As Long, r As Long
    
    Application.ScreenUpdating = False
    r = 1
    fLop = Range("AZ2:AZ556")
    For i = 556 To 2 Step -1
        Cells(i, 52) = fLop(r, 1)
        r = r + 1
    Next
    Application.ScreenUpdating = True
    
End Sub
 
Last edited:

sandy666

Banned - Rules violations
Joined
Oct 24, 2015
Messages
7,497
alternative

PowerQuery

Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table16"]}[Content],
    #"Reversed Rows" = Table.ReverseRows(Source)
in
    #"Reversed Rows"[/SIZE]
 

joeu2004

Banned user
Joined
Mar 2, 2014
Messages
3,080
Office Version
  1. 2010
Platform
  1. Windows
Enter into BA2 (any parallel column) and copy down through BA556:

=INDEX($AZ$2:$AZ$556, ROWS($AZ$2:$AZ$556)-ROWS($AZ$2:AZ2)+1)

The key thing that makes this work is the relative reference highlighted in red.
 
Last edited:
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,629
Messages
5,838,453
Members
430,549
Latest member
jayjay2022

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top