View Single Post
  #13   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_4_] Jim Thomlinson[_4_] is offline
external usenet poster
 
Posts: 1,119
Default What does this do?

I am off to get some coffee. This is more Monday than I am prepared for... :-)
--
HTH...

Jim Thomlinson


"Bob Phillips" wrote:

And you can use

Cells(Rows.Count,"B")

as you now know :-)

Bob


"Jim Thomlinson" wrote in message
...
Thanks Tom. I didn't know that. My programming started after that

(obviously).
--
HTH...

Jim Thomlinson


"Tom Ogilvy" wrote:

While the need is dissipating, in xl5/95, you choice would error. That

is
why most use Rows.count which would work in all situations.

--
Regards,
Tom Ogilvy

"Jim Thomlinson" wrote in message
...
the rows.ccount returns the number of rows in the spreadsheet

(65,536).
The
.end(xlUp) travels up from this row to the first non-blank cell.
Personally
(and this is a personal preference) I would write that line like

this...

lEndRow = wbkNewHdr.Sheets("Macro Records").Range("B65536") _
.End(xlUp).Row

because in my opionion
Range("B65536") is far more clear to read than Cells(Rows.Count, 2)
--
HTH...

Jim Thomlinson


"davegb" wrote:

I got some help here writing some code. I'm trying to do something

very
similar to what this line does, but I don't understand this line.

lEndRow = wbkNewHdr.Sheets("Macro Records").Cells(Rows.Count, 2) _
.End(xlUp).Row

I know it defines the final row in the named worksheet. What I don't
understand is what the .Count does, or why the xlUp is not a xlDown.
Can someone explain this line for me?
Thanks!