+ Reply to Thread
Results 1 to 2 of 2

USEDRANGE

  1. #1
    ak
    Guest

    USEDRANGE

    I use this in VB to check the no. of row used in the activesheet:-

    ActiveSheet.UsedRange.Rows.count

    BUT if the first row is blank then the total no. of row will be minus by one.
    How can the total no. of rows(including the first blank row) be counted?

  2. #2
    Norman Jones
    Guest

    Re: USEDRANGE

    Hi AK,

    Try:

    '=============>>
    Public Sub Tester()
    Dim iCtr As Long

    With ActiveSheet.UsedRange
    iCtr = .Row + .Rows.Count - 1
    End With

    MsgBox iCtr

    End Sub
    '<<=============


    ---
    Regards,
    Norman



    "ak" <[email protected]> wrote in message
    news:[email protected]...
    >I use this in VB to check the no. of row used in the activesheet:-
    >
    > ActiveSheet.UsedRange.Rows.count
    >
    > BUT if the first row is blank then the total no. of row will be minus by
    > one.
    > How can the total no. of rows(including the first blank row) be counted?




+ 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