+ Reply to Thread
Results 1 to 3 of 3

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

  1. #1
    JP
    Guest

    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

  2. #2
    Ron de Bruin
    Guest

    Re: 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" <[email protected]> wrote in message news:[email protected]...
    >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




  3. #3
    JP
    Guest

    Re: 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" <[email protected]> wrote in message news:[email protected]...
    > >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

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1