Matching the Cells then copy paste the Data VBA

  • I need to create a VBA code that is I have two Sheets in a file. Sheet1 and Sheet2.


    I want to match Sheet2 values these values in Sheet1 Column A and Column F if data matches then copy the corresponding columns Data that are Column B,C,D,E and Paste into Sheet2 Column E,F,G,H.


    I also wants to match Sheet2 C3 value that is Column3 in Sheet1 in the Range("G1:Z1") if Column Header is matches then copy the Matched Column Data into Sheet2 Column "i".


    the thing i want is to match the Sheet2 Range A3, B3 and C3 into Sheet1 and copy paste the Data. I have attached the file with example your help will be much appreciated.

  • Will columns A, B and C in Sheet2 always have only one row with data (row 3) as in the file you attached or can you have more than one row with data, for example in rows 3, 4, 5 and 6?

    You can say "THANK YOU" for help received by clicking the "Like" icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • Will columns A, B and C in Sheet2 always have only one row with data (row 3) YES


    Because these are criteria where i have added validation for columns A3, B3 and C3. That will change and data will be copy and pasted accordinlgy



  • Copy and paste this macro into the worksheet code module. Do the following: right click the tab name for your Sheet2 and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Make a selection in A3, then make a selection in B3 and lastly, make a selection in C3. It is very important that the selection in C3 is made last because that selection triggers the macro.

    You can say "THANK YOU" for help received by clicking the "Like" icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • You are very welcome. :)

    You can say "THANK YOU" for help received by clicking the "Like" icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

Participate now!

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