+ Reply to Thread
Results 1 to 8 of 8

VBA to trigger input box when criteria in data founded

  1. #1
    Registered User
    Join Date
    06-08-2016
    Location
    Birmingham, England
    MS-Off Ver
    2010
    Posts
    25

    VBA to trigger input box when criteria in data founded

    This is a bit complicated and I am trying my best to explain it.

    I am trying to find a VBA code which triggers input box when specific criteria is found in data.

    The data has a transaction codes and when criteria from columns A,B,C match it means it is 1 delivery.
    Criteria for a delivery is (Part 1,Identify, PERM-CRE-LOC).


    ColumnA ColumnB ColumnC
    Part number Activity code Operation code
    Part1 Piece-pick PERM-CRE-LOC
    Part1 Identify PERM-CRE-LOC
    Part1 General-movement PERM-ADJ-LOC
    Part1 Identify PERM-CRE-LOC




    By using this formula it returns a value of 2: COUNTIFS($A:$A,""Part 1"",$B:$B,""Identify"",$C:$C,""PERM-CRE-LOC"") . Which means I had two deliveries.
    Is there a way a VBA can do this search and when it finds the matched criteria(delivery) then it triggers the input box?

    I would like input box to give two options:
    1st type in the quantity and 2nd to type in the quantity. Then the typed quantity placed in a different worksheet in specific range? i.e "Worksheet1" range A2 for 1st input and range B2 for 2nd input.
    Can input box also display the number of total found criterias (Deliveries)?. Please help.

    Many thanks

  2. #2
    Registered User
    Join Date
    05-12-2016
    Location
    NZ
    MS-Off Ver
    Office 14
    Posts
    41

    Re: VBA to trigger input box when criteria in data founded

    Try:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-08-2016
    Location
    Birmingham, England
    MS-Off Ver
    2010
    Posts
    25

    Re: VBA to trigger input box when criteria in data founded

    Hello,

    Thank you for a quick reply. This is great it does everything I asked for.

    I have one more question. I am going to have about 30 different part numbers. Should I repeat this code for each part? or there is a way to add more lines somehow?.


    Thank you very much
    Last edited by Addictions; 06-09-2016 at 01:49 PM. Reason: More questions

  4. #4
    Registered User
    Join Date
    05-12-2016
    Location
    NZ
    MS-Off Ver
    Office 14
    Posts
    41

    Re: VBA to trigger input box when criteria in data founded

    Is it just the part numbers that will change or will the other criteria for delivery change as well? (i.e. to count as a delivery, does Part2 use the same values in B and C or are they different?).

    Also, what do you want to happen - do you need separate counts per part type, or do they all add together into DeliveryCount?

  5. #5
    Registered User
    Join Date
    06-08-2016
    Location
    Birmingham, England
    MS-Off Ver
    2010
    Posts
    25

    Re: VBA to trigger input box when criteria in data founded

    The parts are going to change only. It is going to be the same criteria for each part. I would need also to seperate each count for each part with input box seperated for them. The input box results would go to a different cells as well. Thank you for your help

  6. #6
    Registered User
    Join Date
    06-08-2016
    Location
    Birmingham, England
    MS-Off Ver
    2010
    Posts
    25

    Re: VBA to trigger input box when criteria in data founded

    Hi Pango,

    Do you think it is possible to make it?.

    Regards

  7. #7
    Registered User
    Join Date
    05-12-2016
    Location
    NZ
    MS-Off Ver
    Office 14
    Posts
    41

    Re: VBA to trigger input box when criteria in data founded

    It sort of feels like the COUNTIFS function might be more appropriate for that - having 30 unique counts in a macro would be a mess.

    Surely it's easier to have a COUNTIF for each part, and then you can see the DeliveryCount for each, and just type in the Quantity and Quality (like you're doing anyway) next to that? If you don't want to have the count visible after you've done it, either do it on a working sheet, and just copy the Quantity and Quality over, or just delete it after you've done it.


    To modify the macro, you'd have to declare variables for each of your parts (the count):

    Please Login or Register  to view this content.
    ...and then do something like:

    Please Login or Register  to view this content.
    And then you'd need to do this:

    Please Login or Register  to view this content.
    ...30 times, once for each part type, including modifying where the Quality and Quantity paste themselves.

    Like, you can do it, but as far as I can tell it will be a multi-hundred line mess...

  8. #8
    Registered User
    Join Date
    06-08-2016
    Location
    Birmingham, England
    MS-Off Ver
    2010
    Posts
    25

    Re: VBA to trigger input box when criteria in data founded

    Thank you very much for help, I am going definitely to try this out.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 05-02-2016, 07:59 AM
  2. [SOLVED] Countif, Top total Counted, but show once with occurrences founded
    By david gonzalez in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-21-2013, 11:32 PM
  3. Dumb Founded
    By Canadian57 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2012, 05:00 PM
  4. Compare two columns and delete founded values
    By Oleg in forum Excel General
    Replies: 0
    Last Post: 09-28-2006, 09:50 AM
  5. trigger database query on cell data input
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-07-2005, 12:45 PM
  6. How to trigger a macro on a worksheet on the event of user-input?
    By fiven in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-20-2005, 11:38 PM
  7. How to auto-trigger a macro on a worksheet on the event of user-input?
    By fiven in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-19-2005, 11:23 AM

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