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

if column c equal to d then delete that row

Code:
Private Sub CommandButton1_Click()
Dim cell As Range
For Each cell In ActiveSheet.UsedRange.Columns(3).Cells
    If cell.Value = cell.Offset(, 1).Value Then cell.EntireRow.Delete
Next cell
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 so that whenever i run the code it should work on sheet1 plz set worksheet to sheet1 and i need a code without button
 
Without buttons
simply run macro belle in both fil
 

Attachments

  • Keep equal(v3).xlsb
    14.3 KB · Views: 4
  • Example(delete (v2)).xlsm
    15.1 KB · Views: 11
yes belleke i am doing the same and this code is working also but what i want is mentioned sheet1 name, target sheet1 in ur code so that if i am in any sheet for example if i am in sheet6 and i run this code then it should work on sheet1 only thats my moto and that's what i want so plz look into it and do needful
 
Back
Top