06-11-2013, 12:01 PM
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
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