+ Reply to Thread
Results 1 to 5 of 5

Select NonZero rows

  1. #1
    Registered User
    Join Date
    10-01-2009
    Location
    Manassas, VA
    MS-Off Ver
    Excel 2007
    Posts
    86

    Select NonZero rows

    I have 5 columns of data sorted by the Fees (highest to lowest) column D

    I would like to select rows that have fees > 0 to create a Pivot Table.

    Would you help me with a vba code that just select rows from D3 until the last value >0 please?

    Simplify version of column D starting @ D3
    I would like to select rows from 25 thru 1 using vba

    Fees:
    25
    23
    20
    19
    12
    4
    2
    1
    0
    0
    0

    Please advice,

    Thanks,

    NTB
    Last edited by NTB; 04-26-2010 at 10:33 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Select NonZero rows

    Any reason why you can not simply use the pivot table to exclude those records?

    No need for code. Create an named range,

    PDATA: =OFFSET(Sheet1!$A$3,0,0,COUNTIF(Sheet1!$D:$D,">"&0)+1,5)

    Use PDATA as the source data from your pivot table
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    10-01-2009
    Location
    Manassas, VA
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: Select NonZero rows

    Thank you, but I donot know how to apply your method. The code I need is a small portion of a big macro I try to put together.

    I hope I will get the vba for this.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Select NonZero rows

    Then just use the COUNTIF function to tell your code the last row to use as the source data.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-01-2009
    Location
    Manassas, VA
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: Select NonZero rows

    I will test w/ this code later on this afternoon, but I am sure it will work.

    Thanks a lot,

    NTB

+ 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