+ Reply to Thread
Results 1 to 2 of 2

How to determine number of rows that are filled?

  1. #1
    Registered User
    Join Date
    05-07-2004
    Posts
    33

    Question How to determine number of rows that are filled?

    Is there a simple way to determine the number of rows and columns in a workbook? It's hard to specify the range if I don't know the maximum number of rows and columns that I can work with.

    Any help is appreciated.

    ljCharlie

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello ljCharlie,

    If you are interested in the maximum size of a Worksheet, there are 65,536 Rows and 256 Columns. You can also use VBA to return this information as well.

    Code Example of Max Rows and Columns:
    With ActiveSheet
    MaxRows = .Rows.Count
    MaxCols = .Columns.Count
    End With


    If you want to know the maximum size of the Worksheet based on what Rows and Columns that contain data, use the VBA Worksheet property UsedRange.

    Example of Finding Rows and Columns with Data:
    With ActiveSheet.UsedRange
    FirstRow = .Row
    FristCol = .Col
    LastRow = .Rows.Count + FirstRow - 1
    LastCol = .Columns.Count + FirstCol - 1
    End With


    Hope this answers your question,
    Leith Ross

+ 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