+ Reply to Thread
Results 1 to 3 of 3

Counters?, Count Rows?, Get Rows? in an Excel Macro

  1. #1
    C_TB24
    Guest

    Counters?, Count Rows?, Get Rows? in an Excel Macro

    I have an indepth macro created with a very dynamic dataset. The macro is
    copying data from one sheet; pasting to another based on a sales person's
    name (looping to encompass all rows where the criteria is met). I need Excel
    macro VB code (while the application is performing the loop based on the
    sales person's name) to only copy UP TO 10 ROWS of data. One week there may
    only be 2 rows, the next there could be 20; my original report only calls for
    10 entries. Can anyone offer the code needed?

  2. #2
    Ron de Bruin
    Guest

    Re: Counters?, Count Rows?, Get Rows? in an Excel Macro

    See
    http://www.rondebruin.nl/copy5.htm

    Or a Add-in solution
    http://www.rondebruin.nl/easyfilter.htm


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl



    "C_TB24" <[email protected]> wrote in message news:[email protected]...
    >I have an indepth macro created with a very dynamic dataset. The macro is
    > copying data from one sheet; pasting to another based on a sales person's
    > name (looping to encompass all rows where the criteria is met). I need Excel
    > macro VB code (while the application is performing the loop based on the
    > sales person's name) to only copy UP TO 10 ROWS of data. One week there may
    > only be 2 rows, the next there could be 20; my original report only calls for
    > 10 entries. Can anyone offer the code needed?




  3. #3
    Tom Ogilvy
    Guest

    Re: Counters?, Count Rows?, Get Rows? in an Excel Macro

    Assume rng holds a reference to the unconstrained cells to copy

    nRows = Application.Min(rng.rows.count,10)
    rng.Resize(nRows).Copy

    --
    Regards,
    Tom Ogilvy



    "C_TB24" <[email protected]> wrote in message
    news:[email protected]...
    > I have an indepth macro created with a very dynamic dataset. The macro is
    > copying data from one sheet; pasting to another based on a sales person's
    > name (looping to encompass all rows where the criteria is met). I need

    Excel
    > macro VB code (while the application is performing the loop based on the
    > sales person's name) to only copy UP TO 10 ROWS of data. One week there

    may
    > only be 2 rows, the next there could be 20; my original report only calls

    for
    > 10 entries. Can anyone offer the code needed?




+ 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