Option Explicit
Sub Hasson_V2()
Application.ScreenUpdating = False
Dim LRow As Long, LCol As Long, i As Long
Dim ws1 As Worksheet, ws2 As Worksheet
Set ws1 = Worksheets("Sheet1")
Set ws2 = Worksheets("Sheet2")
Dim a, b
ws2.UsedRange.Clear
With ws1.Range("A1").CurrentRegion
.Copy
ws2.Range("A1").PasteSpecial xlPasteAll
ws2.Range("A1").PasteSpecial xlPasteColumnWidths
.Copy ws2.Range("A1")
Application.CutCopyMode = False
End With
LRow = ws2.Cells.Find("*", , xlFormulas, , 1, 2).Row
LCol = ws2.Cells.Find("*", , xlFormulas, , 2, 2).Column + 1
a = ws2.Range("D2:E" & LRow)
ReDim b(1 To UBound(a, 1), 1 To 1)
For i = 1 To UBound(a)
If a(i, 1) + a(i, 2) = 0 Then b(i, 1) = 1
Next i
ws2.Cells(2, LCol).Resize(UBound(a)) = b
i = WorksheetFunction.Sum(Columns(LCol))
ws2.Range(ws2.Cells(2, 1), ws2.Cells(LRow, LCol)).Sort Key1:=ws2.Cells(2, LCol), order1:=1, Header:=2
If i > 0 Then ws2.Cells(2, LCol).Resize(i).EntireRow.Delete
LRow = ws2.Cells.Find("*", , xlFormulas, , 1, 2).Row
With ws2.Range("A2:A" & LRow)
.Formula = "=Row()-1"
.Value = .Value
End With
Application.ScreenUpdating = True
End Sub