Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
David,
Try something like the following: Dim Rng As Range Dim Ar As Range Dim C As Range Set Rng = Range("A1,A5,A7,A12") For Each Ar In Rng.Areas For Each C In Ar Debug.Print C.Row Next C Next Ar -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "David" wrote in message ... The following code returns 1 ,2 , 3, and 4 for the row numbers of the non contiguous range rng. Sub Code1 () Dim rng As Range Set rng = Range("A1,A5,A7,A12") For c = 1 To 4' myArray(c) = rng.Cells(c).Row Next End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formula to define non-contiguous range? | Excel Discussion (Misc queries) | |||
Join non-contiguous ranges into one range via named range? | Excel Discussion (Misc queries) | |||
Non-Contiguous Named Range? | Excel Discussion (Misc queries) | |||
Non-contiguous named range | Excel Discussion (Misc queries) | |||
SUMIF non-contiguous range | Excel Worksheet Functions |