Extract rows of data meeting criteria

  • Hello,


    I am trying to extract data from a closed workbook meeting specific criteria.


    This is what I have...


    A Workbook called "InvoiceList.xlsx", that stores a list of invoice that have been created by multiple sales staff. This workbook needs to stay closed so when a new invoice is created it can store the info in there.


    Each row contains information as following...


    A = Invoice Number in the this format Inv-170152
    B = Date invoice was created
    C = Sales Staff that created the invoice
    D = Customer's name
    E = Before tax amount
    F = With tax amount
    G = Job number
    H = Quote number


    What I need...


    Each sales staff needs to have his/her own list of invoices they created. I have created new workbooks for each sales staff where I would like to extract their invoice list into.


    I need a code that would look for "John Bergen" in column C and extract all the data from that row A - H and paste it in "InvoicesJohn.xlsm" in the next empty row. A1:H1 are column headers so the pasting needs to start at A2.

  • Re: Extract rows of data meeting criteria


    Hi SaraO,


    Try this where the data is pulled from a tab called Sheet1 from a column header titled Created By where the records in that column equal John Bergen (change the strMySQL line to suit):



    Regards,


    Robert

  • Re: Extract rows of data meeting criteria


    Thank you Trebor76!


    It works like a charm. I appreciate you taking the time to help me out with this.

Participate now!

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