Private Sub Worksheet_Activate()
If Range("B1") = "0" Then
Exit Sub
Else
On Error Resume Next
Range("A2:A10000").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
ActiveSheet.UsedRange
End If
Dim x As Long
Dim LastRow As Long
LastRow = Range("A400").End(xlUp).Row
For x = LastRow To 1 Step -1
If Application.WorksheetFunction.CountIf(Range("A2:A" & x), Range("A" & x).Text) > 1 Then
Range("A" & x).EntireRow.Delete
End If
Next x
Range("A3:A10000").Sort Key1:=Range("A3"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub
يا حبذا استاذي العزيز شرح لهذا الكود لكي افهمه ... فلا استطيع ان اطبق شيء لا افهمه
يا رب تتحمل اسئلتي يارب .............