You could create a named range within your Excel sheet and then use that
name to access the data from VB. The excel range object has columns and
rows collections which both have a count property.
Example:
Dim lMaxRows as long
lMaxRows = objExcelSheet.Range("MyRangeName").Rows.Count
This may not be possible if you are accessing the data from ADO. It would
be possible if you were opening the Excel sheet via automation from VB.
There are pros and cons to both approaches.
Cheers
Rob
Quote:
> Hi everyone
> I'm doing an import of data from an excel worksheet into an array (to show
> in an unbound grid). My question is, how can I find out the number of
> columns that are populated, and the number of populated rows? IE when a
> user presses control-end in Excel the active cell becomes the farthest
> bottom right of the populated worksheet.
> Your help would be much appreciated,
> With many thanks in advance,
> Lucy Aldridge