VBA: Count the Number of Used Rows

September 7th, 2004 | Categories: VBA | Tags: , ,

The following code will return in a message box the total number of rows used in a worksheet. Empty rows are considered used if data follows the empty row.

MsgBox ActiveSheet.UsedRange.Rows.Count
  1. Dimo
    August 19th, 2009 at 13:38
    Reply | Quote | #1

    MsgBox ActiveSheet.UsedRange.Columns.Count

    Works for columns’ number

  2. November 22nd, 2009 at 18:53
    Reply | Quote | #2

    You save my day! thanks, it really helps.