View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default finding the last row populated in an excel object

John,

It's my mission to remove code such as Range("A65536")<VBG

It should be (IMO)

Range("A"&Rows.Count)

it may vary one day, it certainly hasn't always been 65536.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"John Wilson" wrote in message
...
eli,

range("a65536").End(xlUp).Row
Will give you the row number of the very last row with data in column "A".

range("a4").End(xlDown).Row
Will give you the last row that's not blank starting at "A4"

Just add 1 to either of the above.

John

"eli silverman" wrote in message
...
I have a VB application that I am using to create a series of excel

reports. I am using excel's copy from recordset to transfer an
adodb.recordset to my excel object starting in cell A4. The problem I need
to resolve is I need to find the highest row populated in the excel

object.
For whatever reason I am unable to access the adodb.recordset's

..recordcount
property. I need to add text at the bottom of the excel so I want to be

able to see that the highest populated row is 255 now I can assign a text
value to cell A256. How do I identify the maximum row populated in column

a
considering that data in column A will not begin untill cell A4. Any help
will be greatly appreciated. Thanks in advance.