by Christopher Shea (1 Submission)
Category: Databases/Data Access/DAO/ADO
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 8th August 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
I had the need to find the amount of used rows or records in an excel spread sheet. The following code will give you a good record count out
API Declarations
Dim wks As Excel.Worksheet
dim xlsWorkSheet as string
dim xlsCount as string
xlsWorkSheet = wkb.Worksheets(1).Name ' Gives name of first worksheet.
Set wks = wkb.Worksheets.Item(1) ' Set up the worksheet
wks.UsedRange.Select ' Grab all used rows
xlsCount = Selection.Rows.Count ' Count the used rows
wkb.Close True, File1 ' Close the file when your done.
No comments have been posted about I had the need to find the amount of used rows or records in an excel spread sheet. The following c. Why not be the first to post a comment about I had the need to find the amount of used rows or records in an excel spread sheet. The following c.