SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Jun 2009
    Posts
    44
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    getting no of rows in excel

    Hi,

    Is there any way to get the number of rows in an excel sheet by creating an excel object.
    i.e set objexcel=CreateObject("Excel.Application")Set Set set oWorkbook=objexcel.WorkBooks.Open("test.xls")
    Set oS=oWorkbook.Sheets("Sheet1")

    and i want to get the number of rows in that column not the usedrange count.

  2. #2
    Member
    Join Date
    Oct 2005
    Posts
    352
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: getting no of rows in excel

    What do u mean by number of rows in that column? The columns where there is some value and not blank? if so loop around till you find a blank or get the count where you have values

  3. #3
    Member
    Join Date
    Jun 2009
    Posts
    44
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: getting no of rows in excel

    sorry i want to have no of rows in the excel sheet

  4. #4
    Member
    Join Date
    Oct 2005
    Posts
    352
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: getting no of rows in excel

    65536 is the limit for number of rows

  5. #5
    Member
    Join Date
    Jun 2009
    Posts
    44
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: getting no of rows in excel

    i meant i want to know the no of used rows in that excel. so that i can copy it some other excel or import to data table

  6. #6
    Member
    Join Date
    Jun 2007
    Posts
    148
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: getting no of rows in excel

    Set objExcel = CreateObject("Excel.Application")
    Set objWorkbook = objExcel.Workbooks.Open (fileName)
    Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)
    usedColumnsCount = objSheet.UsedRange.Columns.Count
    usedRowsCount = objSheet.UsedRange.Rows.Count
    "God doesn't play dice" - Einstein

 

 

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 Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:14 AM.

Copyright BetaSoft Inc.