• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Conditional copy and paste

if column I equal to column J then paste the symbol to sheet2 as shown in sheet2 of sample file
if column I equal to column K then paste the symbol to sheet2 as shown in sheet2 of sample file
plz see the sample file
 

Attachments

  • Book2.xlsx
    17.1 KB · Views: 5
Code:
Private Sub CommandButton1_Click()
Dim i As Long
    For i = Cells(Rows.Count, 9).End(xlUp).Row To 2 Step -1
        If Cells(i, 9) = Cells(i, 10) Then Range("H" & i).Copy Sheets("Sheet2").Cells(Rows.Count, 1).End(xlUp).Offset(1)
        If Cells(i, 9) = Cells(i, 11) Then Range("H" & i).Copy Sheets("Sheet2").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        'Cells(i, 9).EntireRow.Delete
    Next
End Sub





u have used this code and a button
but in my file i am not using button so changes are required
plz change and modify the code plz mentioned the target sheet in the code
 
Back
Top