How to get the rows count in EXCEL work sheet ??

N

nickong

Hi,all

How to get the rows count in excel worksheet ?

-------------------------------------------
dim i As Integer
i= Sheet1.Rows.Count
-------------------------------------------
i get the number returned: 65536


but my worksheet only contain 5000 rows , how could this happen ?
how can i get the actual count number ?

which funciton should i use ???

Best regards


sincerely yours,
nickong
 
K

Karl E. Peterson

nickong said:
Hi,all

How to get the rows count in excel worksheet ?

-------------------------------------------
dim i As Integer
i= Sheet1.Rows.Count
-------------------------------------------
i get the number returned: 65536


but my worksheet only contain 5000 rows , how could this happen ?
how can i get the actual count number ?

which funciton should i use ???

Try ActiveSheet.UsedRange.Rows.Count
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top