+ Reply to Thread
Results 1 to 4 of 4

Object Type of a selection... counting rows in a selection

  1. #1
    Registered User
    Join Date
    08-22-2005
    Posts
    5

    Object Type of a selection... counting rows in a selection

    I have the following code:

    Please Login or Register  to view this content.
    and I need to count the number of rows selected. as there will be no blank cells
    counting like this should be fine. but i don't know what kind of object "sel" needs to be.

    btw. any idea on how to apply a filter (select only cell containing a certain string) on the selection?

  2. #2
    Registered User
    Join Date
    08-23-2005
    Location
    Japan/India
    Posts
    7
    This code works
    Please Login or Register  to view this content.
    Instruite
    ================
    Ideas that work,
    Concepts that sell.
    ================

  3. #3
    Executor
    Guest

    Re: Object Type of a selection... counting rows in a selection

    Hi Acid-Sky

    I am using code like

    Dim iRows As Integer

    Worksheets("Datos").Activate
    iRows = Excel.Range("A4", Excel.Range("A4").End(xlDown)).Rows.Count

    to count the number of rows.

    If you would like to do something with this range try

    Dim rPart As Range
    Dim iRows As Integer

    Worksheets("Datos").Activate
    rPart = Excel.Range("A4", Excel.Range("A4").End(xlDown))
    iRows = rPart.Rows.Count

    I hoop this is the answer


  4. #4
    Executor
    Guest

    Re: Object Type of a selection... counting rows in a selection

    Hi Acid-Sky


    I am using code like


    Dim iRows As Integer


    Worksheets("Datos").Activate
    iRows =3D Excel.Range("A4",
    Excel.Range("A4").End(xlDown))=AD.Rows.Count


    to count the number of rows.


    If you would like to do something with this range try


    Dim rPart As Range
    Dim iRows As Integer


    Worksheets("Datos").Activate
    Set rPart =3D Excel.Range("A4", Excel.Range("A4").End(xlDown))
    iRows =3D rPart.Rows.Count

    a range is a complex item in Excel so you must use the Set commend.


    I hoop this is the answer


+ 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