Thread: Rows.Count
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Rows.Count

Hi Wally,

The Rows property can be qualified with a worksheet, range or application
object and returns a range object that refers to all the rows in the object
qualifier.

Using Rows without a qualifier is equivalent to using Application.Rows and
will return a range object which refers to all the rows in an Excel
worksheet.

So, if the intention is to return the worksheet row count it is not
necessary explicitly.to qualify the Rows property. If, however, the row
count of a range is sought, then it is essential to qualify: eg:

iRows = Range("MyNamedRange").Rows.Count

or:

With Range("MyNamedRange")
iRows = .Rows.Count
End With

It would be possible to replace the unqualified Rows.Count with (its
current equivalent value of) 65536. Rows.Count , however allows for
(possible) future specification changes and does not require the number to
be memorised.

---
Regards,
Norman



"Wally Steadman" wrote in message
...
OK this is a really goofy question I am sure, but I see many post on the
newsgroups and they say stuff like
Rows.Count and I was wondering where I could find the information that
shows
me it is Rows.Count, when I look in the Help Files under RowCount method I
don't see where it says to type Rows.count. I have used it and know it
works so I am not questioning it, I guess I am trying to find out how to
know when to use the . or something.