Sub smazat()
Dim Countrow As Long
Dim R As Long, c As Long
Dim CalcMode As Long
Dim ViewMode As Long
Dim rngDEL As Range
Dim aVal()
Dim aCon() As String
With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
End With
With ActiveWindow
ViewMode = .View
.View = xlNormalView
End With
aCon = Split("EN,Z,S,B", ",")
With ActiveSheet.UsedRange
.Parent.DisplayPageBreaks = False
Countrow = .Rows.Count
If .Column <> 1 Then
MsgBox "Použitá oblast nezačíná sloupcem A", vbExclamation: Exit Sub
End If
If Countrow = 1 Then
ReDim aVal(1 To 1, 1 To 1)
aVal(1, 1) = .Cells(1, 1).Value
Else
aVal = .Columns(1).Value
End If
For R = 1 To Countrow
For c = 0 To UBound(aCon)
If Left(aVal(R, 1), Len(aCon(c))) = aCon(c) Then
If rngDEL Is Nothing Then
Set rngDEL = .Cells(R, 1)
Else
Set rngDEL = Union(rngDEL, .Cells(R, 1))
End If
Exit For
End If
Next c
Next R
End With
If Not rngDEL Is Nothing Then
rngDEL.EntireRow.Select
' rngDEL.EntireRow.Delete
End If
ActiveWindow.View = ViewMode
Application.Calculation = CalcMode
End Sub