• 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.

keep column b equal to column j data and delete rest data

Status
Not open for further replies.
Belleke we have to keep the data in which column B is equal to column J
and we have to delete the rest data
and u have deleted the equal data and kept the rest data
So it is my request plz look into it and do needful
 
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, 2) <> Cells(i, 10) Then Cells(i, 2).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
 
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, 2) <> Cells(i, 10) Then Cells(i, 2).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
 
Status
Not open for further replies.
Back
Top