# How do I get the row number off of a Excel Row object?

**URL:** <https://www.ruby-forum.com/t/how-do-i-get-the-row-number-off-of-a-excel-row-object/65990>\
**Category:** Ruby\
**Created:** [August 22, 2006, 7:37pm UTC](https://www.ruby-forum.com/t/how-do-i-get-the-row-number-off-of-a-excel-row-object/65990 "2006-08-22T19:37:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [August 22, 2006, 7:37pm UTC](https://www.ruby-forum.com/t/how-do-i-get-the-row-number-off-of-a-excel-row-object/65990/1 "2006-08-22T19:37:20Z")

</div>

I have the following code  
script.rows(1:10).each {  
|row|  
}

Is there a way that I can call something like row.rowNumber?

I just need to know what row num I am on.

I have tried each\_with\_index, but that does not seem to work with this  
type of collection.

Thanks for any help

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [August 22, 2006, 10:51pm UTC](https://www.ruby-forum.com/t/how-do-i-get-the-row-number-off-of-a-excel-row-object/65990/2 "2006-08-22T22:51:52Z")

</div>

try “row.Address”. hope that helps.
