Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Oct 2003
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Excel maximum row count (Excel 2000)

    I am loading a number of rows from an ADO recordset using ActiveSheet.QueryTables.Add(), and then I am subtotaling and grouping in Excel. How to I get the maximum number of columns and rows that is now in the worksheet?

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Excel maximum row count (Excel 2000)

    Are you looking for something like:

    NumRows = activesheet.usedrange.row + activesheet.usedrange.rows.count-1

    NumCols = activesheet.usedrange.column + activesheet.usedrange.columns.count-1

    Steve

  3. #3
    New Lounger
    Join Date
    Oct 2003
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel maximum row count (Excel 2000)

    I will give that a try. I didn't know it was insomething called "usedrange". FYI: Just try looking in google under "excel maximum row" or "excel counting rows" or "excel getting maximum number of rows in worksheet". Seems like I could have found it that way. Thanks!

  4. #4
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel maximum row count (Excel 2000)

    Just for the record, Excel has a fixed max number of rows (65536). It is the number or *used* rows you are after.
    So searching for max rows will probably yield all sorts of questions where users need more than the 65536.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

Posting Permissions

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