Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would use a ParamArray to process the comma
delimited ranges and then iterate each range individually, something like this... Function Test(ParamArray R() As Variant) Forgive me, but I don't see how that addresses my question. I specifically asked about passing a reference union of the form (A1,A3,A5). The issue is determining its size. .....<snip I was wondering if a parameter of the form (A1,A3,A5) is a different type of object than A1:A5. So if I declared myVal as Variant instead of Range, which I should do anyway for an unrelated reason, perhaps I could distinguish a reference union in some way programmically (e.g. like TypeName, but I know that does not do the trick), and some property of that object would give me its size. As I noted previously, myVal.Rows.Count does not suffice. Sorry, but I totally missed the point of your question when I first read your message. I think you may be looking to count the areas, not the rows. Given this function declaration... Function myIRR(myVal as Variant, Optional myGuess as Double = 0.1) consider this... NumberOfRanges = myVal.Areas.Count This would properly count three even if one of the ranges was a contiguous range reference. For example, if the union was (A1,A4:A7,A9), the area count would still be 3 even though the total number of cells is 6. You can iterate the areas by index value. For example... For N = 1 To myVal.Areas.Count Debug.Print myVal.Areas(N).Address Next Is this what you were looking for? -- Rick (MVP - Excel) |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
unions, intersections or array constants | Excel Worksheet Functions | |||
formula to work in a 3-d reference with 2 work books | Excel Worksheet Functions | |||
Help.. Drag reference to the right does not work... | New Users to Excel | |||
Advanced Filters with Unions | Excel Programming | |||
Sorting Unions | Excel Programming |