How to count number of rows and column in excel

1,756 views
Skip to first unread message

Pinaki Mishra

unread,
Aug 18, 2009, 6:41:58 PM8/18/09
to Mercu...@googlegroups.com
Hi,
Can can any one help me to count number of row and column that contains data only in excel?

Cheers,
Pinaki

Sreedhar Mallipeddi

unread,
Aug 18, 2009, 11:02:01 PM8/18/09
to mercu...@googlegroups.com
use "Used Range" ..u will the total no of rows and column used in excel
--
Mallipeddi Sreedhar
91-9000994721

rentala vdml

unread,
Aug 20, 2009, 8:44:54 AM8/20/09
to mercu...@googlegroups.com
create an excel object in QTP.
We can reteive no of rowa and cols using Row Count and Column Count Methods


 
On Wed, Aug 19, 2009 at 4:11 AM, Pinaki Mishra <pmish...@googlemail.com> wrote:

rentala vdml

unread,
Aug 20, 2009, 8:56:01 AM8/20/09
to mercu...@googlegroups.com
Hi,
 
Here is the code for your refernce
set obj=CreateObject("Excel.Application")
obj.workbooks.open("file path")
Set obj1=obj.Sheets("Sheet1")
set obj2=obj1.UsedRange
n1=obj2.Rows.Count
n2=obj2.columns.count
MsgBox n1
MsgBox n2
 

 
On Wed, Aug 19, 2009 at 4:11 AM, Pinaki Mishra <pmish...@googlemail.com> wrote:

naveen naveen11

unread,
Aug 20, 2009, 10:43:11 AM8/20/09
to mercu...@googlegroups.com
 In addition to this you can also "UsedRange" for column count so that you will get exact column which used.

Neo Motlokoa

unread,
Aug 6, 2015, 10:15:11 AM8/6/15
to QTP - HP Quick Test Professional - Automated Software Testing
Hi, 
You just made my day supper, I'm daniel
Reply all
Reply to author
Forward
0 new messages