Results 1 to 3 of 3

Thread: ***Resolved*** Excel Columns and rows count

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2000
    Posts
    62

    Unhappy ***Resolved*** Excel Columns and rows count

    Hi All,

    I would like to fined out how many columns and rows i have in my spread sheet in my excel.

    I tried to get it with

    wksheet.Columns.count

    but it gave me all the columns and not only the one that are filled.

    thank - Lin.
    Last edited by lin; Jul 14th, 2003 at 04:22 AM.

  2. #2
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697
    These little loops will find how many rows and columns you have used. Hope it helps....

    Code:
    Sub CountRows()
    Dim Counter As Integer
    oXLApp.Worksheets("Sheet1").Select
    Range("A1").Select
    Do Until ActiveCell.Value = ""
    ActiveCell.Offset(1, 0).Select
    Counter = Counter + 1
    Loop
    End Sub
    Code:
    Sub CountColumns()
    Dim Counter As Integer
    oXLApp.Worksheets("Sheet1").Select
    Range("A1").Select
    Do Until ActiveCell.Value = ""
    ActiveCell.Offset(0, 1).Select
    Counter = Counter + 1
    Loop
    End Sub

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2000
    Posts
    62
    thanks allot for your help

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