What is the code to delete multiple rows if the cell in C:F column has same value, as in the file attached, thanks for any help
What is the code to delete multiple rows if the cell in C:F column has same value, as in the file attached, thanks for any help
Last edited by bezbid; 04-03-2016 at 09:21 AM.
Try:![]()
Sub DeleteRows() Application.ScreenUpdating = False Dim LastRow As Long LastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row Dim x As Long For x = LastRow To 1 Step -1 If WorksheetFunction.CountIf(Range("C" & x & ":F" & x), Cells(x, "C").Value) = 4 Then Rows(x).EntireRow.Delete End If Next x Application.ScreenUpdating = True End Sub
You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
Practice makes perfect. I'm very far from perfect so I'm still practising.
Thanks Mumps1
You are very welcome.![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks