Тогда эти две процедуры надо заменить:
Код |
---|
Sub Job_sum_sheet1(shSum As Worksheet) With shSum Dim y As Long With .UsedRange y = .Row + .Rows.Count End With If y < 2 Then y = 2 .Rows("2:" & y).Delete Shift:=xlUp End With End Sub |
Код |
---|
Sub DeleteEmptyRow(sh As Worksheet) With sh Dim y As Long y = .Cells(.Rows.Count, 1).End(xlUp).Row Dim a As Variant Dim e As Variant If y = 1 Then y = 2 a = .Range(.Cells(1, 1), .Cells(y, 1)) e = .Range(.Cells(1, 5), .Cells(y, 5)) For y = UBound(a, 1) To 2 Step -1 If a(y, 1) = "" Or e(y, 1) <> "+" Then .Rows(y).Delete End If Next End With End Sub |