How to get the number of used rows from excel spreadsheet in VBScr

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need a piece of script, that connects to an ALREADY OPEN excel spreadsheet
and get the number of used rows, using VBScript. So far I was unable to do it
and I found solutions only in VB or other languages. Please help if you know
how to.
Thanks,
Judit
 
Hi JP

You can use
MsgBox ActiveSheet.UsedRange.Rows.Count

Remember this is not always give you the last row with data.
The usedrange not always start in row 1
 
Thanks for the help, but my problem really is not to get the used rows but
first to get an object reference to an already open excel spreadsheet. If I
run this line it will give me and error "Object required 'ActiveSheet'", so I
need to find out how to get an object reference to an already open excel
sheet. It would be gread if you could help me with that.
Thanks a bunch.
Judit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top