Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I sent you solution privately, but just for this thread: An array of Ranges output: Function Tester2() As Variant Dim OutputRanges() As Range, i As Integer AreaCount = Selection.Areas.Count ReDim OutputRanges(1 To AreaCount) For i = 1 To AreaCount Set OutputRanges(i) = Selection.Areas(i) Next i Tester2 = OutputRanges End Function Public Sub test() Dim myValues As Variant For i = 1 To UBound(Tester2) Set Testarea = Tester2(i) MsgBox Testarea.Address Next i End Sub A Collection of Ranges output: Function Tester2() As Collection Dim OutputRanges As New Collection, i As Integer AreaCount = Selection.Areas.Count For i = 1 To AreaCount OutputRanges.Add Selection.Areas(i), "Area" & i Next i Set Tester2 = OutputRanges End Function Public Sub test() Dim Testarea as Range Dim myValues As Variant For i = 1 To Tester2.Count Set Testarea = Tester2("Area" & i) MsgBox Testarea.Address Next i End Sub regards Paul |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problem with getting numbers in some range values!? | Excel Worksheet Functions | |||
Stumped! Collecting values into one cell. | Excel Worksheet Functions | |||
Stumped! Collecting values into one cell. | Excel Worksheet Functions | |||
Collecting values for later display? | Excel Programming | |||
collecting previous values | Excel Programming |