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
| Option Base 1
Sub RechRempl()
Dim TabColonne() As Variant
Dim DerLig As Long, DebutLig As Long
Dim Recherche(), Remplace()
Dim i As Long, t As Long
Dim Plage As Range
' colonne A / C / E
TabColonne = Array(1, 3, 5)
' les trois rechercher/remplacer
Recherche = Array("oui", "non", ""): Remplace = Array(1, 0, 0)
' ligne de départ et de fin
DebutLig = 2: DerLig = 170
' boucle sur chaque recherche
For t = LBound(Recherche) To UBound(Recherche)
' boucle sur chaque colonne
For i = LBound(TabColonne) To UBound(TabColonne)
Set Plage = Range(Cells(DebutLig, TabColonne(i)), Cells(DerLig, TabColonne(i)))
Plage.Replace _
What:=Recherche(t), _
Replacement:=Remplace(t), _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
MatchCase:=False, _
SearchFormat:=False, _
ReplaceFormat:=False
Next i
Next t
End Sub |
Partager