#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Rows.Count

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.


  #2   Report Post  
Posted to microsoft.public.excel.programming
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.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Rows.Count

Wally,

In many ways this is a catch-22 situation, in that you need to about what
you are looking up to look it up ;-).

But, happily, there are some strategies you can use. Essentially, you need
to familiarise with the Excel object model. Start by looking up 'Microsoft
Excel Object' in help, you will see the first level there are you click on
any object to look at the next level down, and so on.

Another good way is to open the object browser in the VBE. Select Excel from
the dropdown, and here you can see various objects and constant groups on
the left, with associated properties and methods on the right. So for
instance, if you select Range, you can see Rows on the right, which shows
that Range has a Rows property.

In intellisense, if you type an item, you will get a dropdown list of
properties and methods associated with it, so again, type Rows. (note the
dot) in the immediate window, and you will see the methods and properties
for Rows (which includes Count here).

Then you need experience and apply that experience (the catch-22 as I
mentioned). Most collections will have a Count property,. so knowing that
you are dealing with a collection gives you a hint. But you need to do your
homework, get to know the object model, investigate the properties and
methods, read the posts to see what is being discussed, practice, practice,
and then practice.


--

HTH

RP
(remove nothere from the email address if mailing direct)


"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.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Rows.Count

Thank you very much. Your suggestion is what I am doing and I appreciate
it. I can do some basic VBA stuff but definitely trying to get better at
it. I have a few books on it so again thank you for your assistance to all
who answered this post.

Wally

"Bob Phillips" wrote in message
...
Wally,

In many ways this is a catch-22 situation, in that you need to about what
you are looking up to look it up ;-).

But, happily, there are some strategies you can use. Essentially, you need
to familiarise with the Excel object model. Start by looking up 'Microsoft
Excel Object' in help, you will see the first level there are you click on
any object to look at the next level down, and so on.

Another good way is to open the object browser in the VBE. Select Excel

from
the dropdown, and here you can see various objects and constant groups on
the left, with associated properties and methods on the right. So for
instance, if you select Range, you can see Rows on the right, which shows
that Range has a Rows property.

In intellisense, if you type an item, you will get a dropdown list of
properties and methods associated with it, so again, type Rows. (note the
dot) in the immediate window, and you will see the methods and properties
for Rows (which includes Count here).

Then you need experience and apply that experience (the catch-22 as I
mentioned). Most collections will have a Count property,. so knowing that
you are dealing with a collection gives you a hint. But you need to do

your
homework, get to know the object model, investigate the properties and
methods, read the posts to see what is being discussed, practice,

practice,
and then practice.


--

HTH

RP
(remove nothere from the email address if mailing direct)


"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.






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count all rows in column with data, Except rows 1-5 Gregory Day Excel Worksheet Functions 4 March 27th 08 02:58 PM
match week, count rows, sum rows? earls Excel Worksheet Functions 2 January 5th 07 02:34 AM
Count number of rows, where non relevant rows are hidden Pieter Excel Discussion (Misc queries) 2 November 8th 06 12:24 PM
Count rows and insert number to count them. Mex Excel Discussion (Misc queries) 6 August 23rd 06 02:29 AM
Why does rngDataSource.Rows.Count = 65536 when worksheet Rows=95? [email protected] Excel Discussion (Misc queries) 12 July 22nd 05 12:50 PM


All times are GMT +1. The time now is 05:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"