View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
David David is offline
external usenet poster
 
Posts: 153
Default Non Contiguous range and loops

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