Click to See Complete Forum and Search --> : Excel Functions
neilg
March 15th, 2005, 05:24 AM
Hi,
I am not sure if my post fit on this forum. In Microsoft Excel, How do i get the number of rows a worksheet have. For example, worksheet1 have 10,000 rows and worksheet2 have 5,000 rows. How could I get those values, what function could I use?
Thanks In Advance,
Neil
Sahir
March 15th, 2005, 05:41 AM
For example, worksheet1 have 10,000 rows and worksheet2 have 5,000 rows. How could I get those values, what function could I use?
An Excel sheet always contains 65,536 rows and 256 columns. To determine how many contiguous rows contain data you need to iterate through the rows.
ovidiucucu
March 15th, 2005, 06:21 AM
UsedRange property returns a Range object that represents the used range on the specified worksheet.
Here is a little example in VBA.
Dim nUsedRows As Integer, nUsedColumns As Integer
Worksheets("Sheet1").Activate
ActiveSheet.UsedRange.Select
nUsedRows = Selection.Rows.Count
nUsedColumns = Selection.Columns.Count
neilg
March 15th, 2005, 10:06 PM
Thanks a lot ovidiu and sahir, I really appreciate your help. I will look into those functions.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.