Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How many rows on a Worksheet

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How many rows on a Worksheet

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)

"Ed Nelson" wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy rows from one worksheet automatically, ignore rows that are b Kris Excel Worksheet Functions 2 October 10th 08 09:28 PM
instering rows in one worksheet that reflect another worksheet Tsato Excel Worksheet Functions 1 August 19th 08 12:51 AM
insert rows in a worksheet that do not change adjoining rows craigandmel Excel Discussion (Misc queries) 2 April 29th 08 10:26 PM
How do I insert blank rows between rows in completed worksheet? bblue1978 Excel Discussion (Misc queries) 1 October 26th 06 07:02 PM
Why does rngDataSource.Rows.Count = 65536 when worksheet Rows=95? [email protected] Excel Discussion (Misc queries) 12 July 22nd 05 12:50 PM


All times are GMT +1. The time now is 02:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"