Paste the data based on condition

  • My question is, how do I copy the data from one sheet and paste into other sheet based on the condition. Here is example data and output what i want.
    [ATTACH=CONFIG]68574[/ATTACH]




    First I want to copy the data of column D (if value of column E is greater than 0,then it paste two times in second sheet,other wise paste one time in second sheet.
    I want output like


    [ATTACH=CONFIG]68575[/ATTACH]
    in sheet one first value of E is 0 then it copy the data of column a and paste one time in sheet 2 and second the value of column E is greater than 0 the it paste the data two times in sheet two.



    Thanks in advance and apologies for my explanation skills.


    excel vba button range criteria
    [TABLE="class: fw, width: 660"]

    [tr]


    [TD="class: vt"]shareimprove this question
    [/TD]
    [TD="class: post-signature, align: right"]edited Jan 15 '14 at 14:05





    [/TD]
    [TD="class: post-signature owner, bgcolor: #E0EAF1"]asked Jan 14 '14 at 11:02
    [Blocked Image: https://i.stack.imgur.com/19E5p.jpg?s=32&g=1]

    drblacko313



    [/TD]

    [/tr]


    [/TABLE]


    add a comment

  • Re: Paste the data based on condition


    Try the below code ! Next time please attach a sample workbook so that it will be easy for people who are willing to help!


  • Re: Paste the data based on condition


    Thanks Mohammedismail for help .it works perfectly. But in sheet2 i want to paste in cell A46 to A55. Cell( A43,A44,and A45) are merged.
    if i find the non blank cell using
    x=Range("A55").End(xlUp).Row
    then it will return A43 not A45 because of merging.Can any body help me.
    Thanks to everybody in advance.



Participate now!

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