VBA Find Copy Paste

  • Dear Forum,


    Newbie to VBA here and would appreciate some advice or help on the below query please.


    I have searched through the forum and Google and found a few bits and pieces that almost match but I dont have the knowhow to amend the code. What I am trying to achieve is:


    - I have a basic userform to enter data, when a command button is clicked the data is transferred into a ws called "Update Quality Check Data" - this works perfeclty so far
    - What I am now trying to do is find data in the ws "Update Quality Check Data: transfer it to a table in another sheet.


    In the ws:


    - Column A:A contains Months
    - Column B:B contains Names
    - Column C:C contains Ticket Numbers


    What I need to do is transfer onlythe Ticket numbers to seperate sheets If month and Name match, the sheet looks something like this:



    A B C
    June John 123
    June William 456
    July John 789
    July David 101
    July Bob 112


    So to summarize what I would like to achieve is:


    IF A:A = "June", AND B:B = "John"
    Copy C:C orders of John in June, July etc. to ws named John starting at cell D5 and going down until there is no more matching entries


    I have tried to have a go as per below but failed miserably so far:




    Is this possible? and as people enter the data into the useform would this automatically update the table on John's ws?


    Sorry for the complex babble, hopefully it makes some sense.


    Kind Regards


    Bob

  • Re: VBA Find Copy Paste


    See if this will get you started...


  • Re: VBA Find Copy Paste


    Thanks Fuzz-Head you are a legend it works like a charm! I would just like to ask if the following would be possible as an adjustment?


    1. Is it possible when the user hits the Submit button on the UserForm1 that the sheets automatically update? reason I ask is that now it works great but I need to run the code each time data is added, and this then means duplicate entries, which would also lead me to ask
    2. if 1. is possible is there a way to avoid duplicate entries? it is possible the same ticket number a. could appear for more than 1 user and b. could appear more than once for the same user


    Can the code be appended to the Submit button to achieve this?


    Kind Regards


    Bob

  • Re: VBA Find Copy Paste


    The code can be modified to meet your needs, however, would need to see more of a sample to better understand the end results. If it is just making sure that each sheet doesn't have duplicate data, then very easy.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!