1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| Dim p As Range, plage As Range
numcol = Application.IfError(Application.Match("Code OF", Rows(1), 0), 0)
If numcol > 0 Then
Set plage = Columns(numcol)
Else
MsgBox "Erreur : Pas de colonne 'Code OF'"
Exit Sub
End If
With plage
For Each cel In plage.Cells
If cel = "AD-DEBUT" Or cel = "HNONP" Then If p Is Nothing Then Set p = cel Else Set p = Union(p, cel.MergeArea)
Next
End With
p.EntireRow.Delete
Sheets("Temps salariés").Select
Range("A2").Select
numcol = Application.IfError(Application.Match("Salarié (code)", Rows(1), 0), 0)
If numcol > 0 Then
Set plage = Columns(numcol)
Else
MsgBox "Erreur : Pas de colonne 'Salarié (code)'"
Exit Sub
End If
With plage
For Each cel In plage.Cells
If cel = "MACHINSEUL" Then If p Is Nothing Then Set p = cel Else Set p = Union(p, cel.MergeArea)
Next
End With
p.EntireRow.Delete
Sheets("Temps salariés").Select
Range("A2").Select
numcol = Application.IfError(Application.Match("Salarié (code)", Rows(1), 0), 0)
If numcol > 0 Then
Set plage = Columns(numcol)
Else
MsgBox "Erreur : Pas de colonne 'Salarié (code)'"
Exit Sub
End If
With plage
For Each cel In plage.Cells
If cel <> "MACHINSEUL" Then If p Is Nothing Then Set p = cel Else Set p = Union(p, cel.MergeArea)
Next
End With
p.EntireRow.Delete |
Partager