VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



I had the need to find the amount of used rows or records in an excel spread sheet. The following c

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

Rate I had the need to find the amount of used rows or records in an excel spread sheet. The following c




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.


Download this snippet    Add to My Saved Code

I had the need to find the amount of used rows or records in an excel spread sheet. The following c Comments

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.

Post your comment

Subject:
Message:
0/1000 characters