Results 1 to 2 of 2

Thread: how can I get a row count

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    UK
    Posts
    300
    Hi
    How can I get a row count of what is in an excel sheet that I am using

    heres my code:

    spreadsheetname = PathToExcel & GS

    On Error Resume Next
    With objXLS
    .Workbooks.Open spreadsheetname

    Dim cell As Object
    For lng = 2 To 10000
    Cells(lng, 20).Select
    For Each cell In Selection
    cell.Value = "'" & cell.Value

    Next
    Next


    ActiveWorkbook.Save

    .Workbooks.Close

    End With
    Set objXLS = Nothing

    I am looping to 10000 as I don't know how many rows are in the spreadsheet. How can I determine this so I can use it in my loop. ?

    Cheers
    Resistance is futile

  2. #2
    Lively Member xhomerx's Avatar
    Join Date
    Feb 2001
    Posts
    98
    In Excel 2000 the max amount of rows is 65536

Posting Permissions

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



Click Here to Expand Forum to Full Width