[AccessD] OT: Excel 97 Macro

Gustav Brock gustav at cactus.dk
Sat Mar 22 11:41:00 CST 2003


Hi John

> What would be nice is to know the ending row of the data.  Does anyone know
> off the top of their head how to determine the max size (the largest row
> index) of a populated row?  Remember I am working with what appears to be a
> table - fixed column count / fixed row count.  What is the numbers of
> records in that table (as determined in Excel).  I can always if necessary
> just link the table in and get a record count but it would be nice to figure
> it out in Excel.

If you have nothing but data in that sheet and these are filled from
cell A1, then you could use something like this:

  Dim rng As Range

  Set rng = ActiveWorkbook.Worksheets("Data").UsedRange
  Debug.Print rng.Rows.Count, rng.Columns.Count

/gustav




More information about the AccessD mailing list