How many rows on a Worksheet

  • Thread starter Thread starter Ed Nelson
  • Start date Start date
E

Ed Nelson

I am trying to find out how many rows there on a Worksheet
using VBA code. I am doing data extraction on XLS files I
received from another company, and so I never know how
many rows there can be on a work sheet.

I have tried:
Application.SendKeys "^{END}", True
iRows = ActiveCell.Rows

But his always returns 1.

Any ideas?

Thanks!

Ed
 
Try

iRows=cells.specialcells(xllastcell).row

--

HTH

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

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

Back
Top