Yes, I did miss your point. Let me try again then. Here is part of the
description of the Rows property from the VBA help files...
"For a Range object, returns a Range object that
represents the rows in the specified range."
Then, for these two statements..
Set r=range("A1:C3")
Set r2 = r.Rows(1)
The Rows property of the 'r' range returns the first row (because of the 1
in parentheses) of the range A1:C3. While it is true that the cells in that
range are A1, B1 and C1, the Rows property is not returning them
individually... Rows(1).Cells (that is, the cells in the first row) would do
that... it returns them as a single, horizontal group of cells... 1 row of
cells to be exact; hence, the Count property returns 1... for the count of
cells in the row, you would use r2.Cells.Count to get that.
--
Rick (MVP - Excel)
"Dave Unger" <(E-Mail Removed)> wrote in message
news:0050df8b-a1ce-4e39-adc3-(E-Mail Removed)...
Hi Rick,
On Sep 16, 1:57 am, "Rick Rothstein"
<rick.newsNO.S...@NO.SPAMverizon.net> wrote:
> Just to be clear about this... Rows(1) is the same as Range("A1:IV1") for
> versions of Excel prior to XL2007 and Range("A1:XFD1") for XL2007. So the
> Intersect function is finding the range of cells in common between
> Range("A1:C3") and, for say XL2003, Range("A1:IV1"). That intersection is
> the three-cell range Range("A1:C1"), whose Count property is 3.
Thanks for your reply. Either I'm missing your point, or you're
missing mine.
Set r=range("A1:C3")
Set r2 = r.Rows(1)
The address of r2 is A1:C1, and I would expect r2.Count to return 3,
but it doesn't - it returns 1
regards,
Dave.
|