Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
to count the number of used rows in a particular column
#1
Not Solved
hi,
I have an excel sheet with different values for different columns
The used row count for each column is diffrent.

Can I get the used range count for a particular colum say eg:Column C.
I need to set this value as the limit for my For loop.

I tried the below but is useless as usedrange always returns the longest columns row count

Code:
Set Excel=createobject("excel.application")

Excel.visible = True
Set wkb = Excel.Workbooks.Open("D:\report period.xls")
Set ws = wkb.Sheets(1)
p=ws.UsedRange.Rows.Count
Reply


Messages In This Thread
to count the number of used rows in a particular column - by sujaravi123 - 06-11-2013, 12:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  does WebTable Object provides a method to get column number umer830 4 12,486 07-06-2018, 09:32 AM
Last Post: vijaychourasiya0109@gmail.com
  How to Delete Rows with duplicate values in 1 columns in excel thru QTP. arpan 0 2,641 02-09-2015, 08:47 PM
Last Post: arpan
  How to get center data value in a odd number of rows and columns web table ... sai rajesh 0 2,615 11-13-2013, 10:24 PM
Last Post: sai rajesh
  Problem with Multiple rows retrieval from mySQL and save it some variable Dejavu 1 1,980 03-15-2013, 02:52 PM
Last Post: basanth27
  Wrong count for UsedRange rows and columns in datatable. qtpexpert 2 6,150 06-20-2012, 04:35 PM
Last Post: qtpexpert

Forum Jump:


Users browsing this thread: 1 Guest(s)