View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default getting coordinates of a range

Hi

one way

Firstrow = Range("b3:b33").Cells(1).Row
'This give you the row number of the first cell in the range

Rcount = Range("b3:b33").Rows.Count + Firstrow
'This give you the last row in the range

Sub test()
Firstrow = Range("b3:b33").Cells(1).Row
LRow = Range("b3:b33").Rows.Count + Firstrow

For Rownumber = Firstrow To LRow Step 1
MsgBox Rownumber
'MsgBox Cells(Rownumber, "A").Value
Next
End Sub




--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Kent Eilers" wrote in message ...

ok - spent over an hour on this so far with no luck ...(including google
newgroups)

I want to get the row number for each row in a range....so if a range has 30
rows starting at B3 then I want 3,4,5.....33 returned.

Is this possible? Probably easy but I'm missing it....

If this was access I would use the "for each row in myrange.rows"
collection and look at the property values to get this but I noticed excel
does not have a 'property' nor 'row' object.

Thanks

--
kent eilers