Jump to content

How to count total number of rows in a excel column


Recommended Posts

Set ExcelObj = createobject("excel.application")
ExcelObj.Visible = true
Set ExcelConfigFile = ExcelObj.Workbooks.Open (Path)
Set Sheet = ExcelConfigFile.Worksheets("Scripts")
TotalRow = Sheet.UsedRange.Rows.Count


So far, I get total number of row of the sheet. I have a column called "key". How can I count total number of rows in the key column?


Link to comment
Share on other sites

Is that different from the rows in the sheet?  Look at the documentation for that object you're using, and see what properties and methods are available.  I assume instead of the UsedRange property you'll want to use a different one, maybe even define your own range.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...