Heenan, Lambert
Lambert.Heenan at AIG.com
Thu Feb 2 11:24:35 CST 2006
This is a situation where you can use the Select method of a Range object. E.g. Assuming xlSheet is an initialized Excel.Worksheet object, and "A1" is within your block of data... With xlSheet .Range("A1").Select strRange = .Range("A1").CurrentRegion.Address End With ... After that strRange will have the address of the whole range, like "$A$1:$D$144", from which you can derive your row count. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Thursday, February 02, 2006 12:01 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] How many rows populated in range Does anyone know how to determine how many rows of a range are actually populated with data? I have a range with Doc DocDescr Otherstuff etc 1A Some Desce Etc Etc 1Ai Other Descr Etc Etc The range is potentially up to a hundred and some rows. Doc and DocDescr will always have data in it, but the other columns might not. Is there any property of the range that says what the last occupied row is? Are there iterators for ranges, i.e. "for each row in Range" kind of thing? John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com