Consulting

Results 1 to 6 of 6

Thread: VBA to trigger input box when criteria in data found

  1. #1
    VBAX Regular
    Joined
    Jun 2016
    Posts
    7
    Location

    VBA to trigger input box when criteria in data found

    Hello,

    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).

    Column A Column B Column C
    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
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    You could use the Worksheet Change event to trigger a Sub that looks for a match. Then if that sub finds a match, it triggers a VBA UserForm that does all the rest.

    The worksheet Change Event occurs every time changes to the sheet are made by a User, so there would only ever be one match. The Change Event also happens at certain other Changes.

    Assigning a certain Cell that triggers a Sub when Double-clicked or adding a button to the sheet or adding a menu Item to the Workbook are other ways to trigger a sub.

    Using a Cell formula won't work.

    $A:$A,""Part 1"",$B:$B,""Identify"",$C:$C,""PERM-CRE-LOC"") . Which means I had two deliveries.
    Is that the only combination of values possible that you need to have the Input UserForm run on?
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    VBAX Regular
    Joined
    Jun 2016
    Posts
    7
    Location
    Hello,

    Thank you for a quick reply. There are going to be more part numbers to look at only.

  4. #4
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    So any part number + "Identify" + "PERM-CRE-LOC"?
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  5. #5
    VBAX Regular
    Joined
    Jun 2016
    Posts
    7
    Location
    This is correct

  6. #6
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    What about any part number + "Identify" + something besides "PERM-CRE-LOC"?
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •