Sub test()
Dim texteCherche As String, texteRemplace As String, curSheet As Worksheet, tmpWbk As Workbook
' récupérer le texte à remplacer
texteCherche = CStr(Application.InputBox("texte cherché"))
' récupérer le nouveau texte
texteRemplace = CStr(Application.InputBox("nouveau texte"))
' boucler sur les classeurs ouverts
For Each tmpWbk In Application.Workbooks
' ne pas traiter ce classeur
If tmpWbk.Name <> ThisWorkbook.Name Then
' boucler sur chaque feuille du classeur
For Each curSheet In tmpWbk.Worksheets
' remplacer les deux textes
curSheet.Cells.Replace what:=texteCherche, replacement:=texteRemplace, lookat:=xlPart
Next curSheet
End If
Next tmpWbk
End Sub
Sub test2()
Dim theSheet As Worksheet, tmpWbk As Workbook, nomOnglet As String
nomOnglet = "caisse et palettisation"
' boucler sur les classeurs ouverts
For Each tmpWbk In Application.Workbooks
' ne pas traiter ce classeur
If tmpWbk.Name <> ThisWorkbook.Name Then
' si la feuille existe,...
On Error Resume Next
ThisWorkbook.Sheets(nomOnglet).Select
If Err.Number = 0 Then
'...on la supprime
Application.DisplayAlerts = False
ThisWorkbook.Sheets(nomOnglet).Delete
Application.DisplayAlerts = True
End If
On Error GoTo 0
'copier la feuille dans le classeur
ThisWorkbook.Sheets(nomOnglet).Copy after:=tmpWbk.Sheets(1)
End If
Next tmpWbk
End Sub