Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
A function that returns a Range with entries reversed
|
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
A function that returns a Range with entries reversed
Hi,
I made one here, maybe it's near what you want, The function return the range in an array where the last row is the first in the array. Public Function ReturnArr(R As Range) As Variant Dim Arr As Variant Dim Arr2 As Variant Dim Row As Long Dim Col As Integer Dim i As Integer Arr = R Arr2 = Arr Row = 0 'Reverse the array For i = UBound(Arr, 1) To 1 Step -1 Row = Row + 1 For Col = 1 To UBound(Arr, 2) Arr2(Row, Col) = Arr(i, Col) Next Col Next i ReturnArr = Arr2 End Function To test it: Public Sub Test() Dim A As Variant A = ReturnArr(Range(Cells(1, 1), Cells(4, 2))) End Sub -----Original Message----- Would anyone have or be able to direct me to a function that accepts a Range as input and then returns an Array containing the entries in the Range in reverse order. Thanks in advance Ray Kanner . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
LOOKUP function reversed? | Excel Worksheet Functions | |||
"COUNTU" function in Excel to count unique entries in a range | Excel Worksheet Functions | |||
Linkage. Returns #N/A for certain entries | Excel Discussion (Misc queries) | |||
How to count dates within a certain range in a column with mutiple date range entries | Excel Worksheet Functions | |||
Need a function that finds a value in a table range and returns the cell number | Excel Programming |