1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| Private Sub Valider_Click()
Dim OldStr As String, NewStr As String
Dim Sh As Worksheet
Dim c As Range
MsgBox "La commande VALIDER est bien passée"
OldStr = Replace_MCL_Tool.TextBox1.Value
NewStr = Replace_MCL_Tool.TextBox2.Value
For Each Sh In ThisWorkbook.Worksheets
MsgBox "La feuille <" & Sh.Name & "> est sélectionnée"
On Error Resume Next
For Each c In Sh.UsedRange.SpecialCells(xlCellTypeFormulas)
c.Formula = Replace(c.Formula, OldStr, NewStr)
MsgBox "La chaine de caractères <" & OldStr & "> a été remplacée par <" & NewStr & ">." & Chr(10) & _
"La cellule <" & c.Address & "> contient la formule <" & c.Formula & ">."
Next c
On Error GoTo 0
Next Sh
Me.Hide
End Sub
Private Sub Annuler_Click()
Me.Hide
End Sub |