Sub takelrgnom()
Dim LastRow As Long
Dim i As Long
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Activate
Application.DisplayAlerts = False
If ws.Name = "0" Then GoTo xskip
LastRow = Cells(Rows.Count, "F").End(xlUp).Row
If WorksheetFunction.CountA(Range("A:A")) = 4 Then
For i = LastRow To 2 Step -1
If Cells(i, "N").Value <> Application.Evaluate("MAX(IF(" & Range(Cells(1, "F"), Cells(LastRow, "F")).Address _
& "=" & Cells(i, "F").Address & "," & Range(Cells(1, "N"), Cells(LastRow, "N")).Address & "))") Then
Rows(i).Delete
End If
Next i
Application.DisplayAlerts = True
xskip:
End If
Next ws
End Sub
I applied the code..but no effect on data on any sheets...
what can be the reason??
thanks
Gokz
Bookmarks