+ Reply to Thread
Results 1 to 3 of 3

Count Rows Based On User Input & Trigger Print Of Pages Out Of Count Result

  1. #1
    Registered User
    Join Date
    06-21-2012
    Location
    SG
    MS-Off Ver
    Excel 2010
    Posts
    10

    Post Count Rows Based On User Input & Trigger Print Of Pages Out Of Count Result

    Good day,

    I would like to create a macro to count the number of rows based on the user input. And based on the count result, trigger the print function to print the corresponding number of pages.

    For example, I have a table below in Sheet 1 and some other information in Sheet 2. When I input "Apple" into a input box in Sheet 2, the macro will count the number of occurrences for Apple and return the result as 3. So, with this result of 3, a print function is trigger to print 3 pages of the same data in Sheet 2.

    To summarize, the number of pages to be printed is based on the result of the count.

    Apple
    Orange
    Mango
    Apple
    Apple
    Mango

    Appreciate advice from anyone on this.

    Thanks in advance for the help.

    Best regards,
    wliang

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Count Rows Based On User Input & Trigger Print Of Pages Out Of Count Result

    Thinking simply..Use a helper cell..

    In Cell A1 (say) of Sheet2, Use
    =COUNTIF("Table","InputSelection")

    Then use the below code

    Please Login or Register  to view this content.
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Registered User
    Join Date
    06-21-2012
    Location
    SG
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Count Rows Based On User Input & Trigger Print Of Pages Out Of Count Result

    Hi Ace_XL,
    Thanks for your help.

    Best regards,
    wliang

+ 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