VBA results upside down

YanAK

New Member
Joined
Dec 24, 2019
Messages
31
Hi good ppl,
I've created a VBA function that returns an array as result
something like that
1586377803419.png

my question is, is there any worksheet function that can flip the result? so it's 1,251 will be the first row and 665 second and so on.
Ooh and note that i'm already using Trasnpose function, so I can have vertical result instead of horizontal.

Thank you.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Do you mean you want a formula or do you mean you want to get the reverse result from the function?
 
Upvote 0
Its easy to spin an array by creating another of same dimensions and looping bottom to top from the original. Heres an easy to understand way:

VBA Code:
Dim arr, arr2, i As Long, a As Long

arr = Array(1, 2, 3, 4, 5)
ReDim arr2(0 To UBound(arr))

For i = UBound(arr) To LBound(arr) Step -1
    arr2(a) = arr(i)
    a = a + 1
Next
 
Upvote 0

Forum statistics

Threads
1,214,987
Messages
6,122,614
Members
449,090
Latest member
vivek chauhan

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
Back
Top