ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to get the number of used rows from excel spreadsheet in VBScr (https://www.excelbanter.com/excel-programming/320729-how-get-number-used-rows-excel-spreadsheet-vbscr.html)

JP

How to get the number of used rows from excel spreadsheet in VBScr
 
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

Ron de Bruin

How to get the number of used rows from excel spreadsheet in VBScr
 
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



--
Regards Ron de Bruin
http://www.rondebruin.nl



"JP" wrote in message ...
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




JP

How to get the number of used rows from excel spreadsheet in V
 
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

"Ron de Bruin" wrote:

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



--
Regards Ron de Bruin
http://www.rondebruin.nl



"JP" wrote in message ...
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






All times are GMT +1. The time now is 12:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com