Copy values from one worksheet to another based on one condition

  • Hello


    I need a code that will copy values from certain columns (columns D, F) ("worhsheet A") to another worksheet columns X,Z (of "worksheet B") whenever in the source worksheet value of column C is empty.

  • Hello and Welcome to the Forum


    Attaching a sample file would make everything easier ... for everybody :smile:

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Like" icon ...just below...in the bottom right corner...:)

  • Hello and Welcome to the Forum


    Attaching a sample file would make everything easier ... for everybody :smile:


    Hi Carim


    Thanks for your answer. I havent answer cause i was quite busy but thanks for chasing. The way I have fixed it is with the following code: Probably not the most efficient but it works for my needs



    As the step 2 copy data into a table formulas get copied into the last row of the table so no need to have code that copies the values until the last row with data.


    Anyway Carim, thanks a lot for your help!!!

  • Glad you could fix your problem


    Thanks for your Thanks :smile:

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Like" icon ...just below...in the bottom right corner...:)

  • Why would you need VBA to set up formulas?


    Set up a template sheet in the workbook is the simplest way.


    If you really only have one criteria and the data is in a table format then AutoFilter can be automated to do this and will be the most efficient way.


    Note: I have added Code Tags to your previous post, please use them in future because they make your code easier to read and copy. All this is explained in the Forum Rules which you really ought to read.