1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Sub Copier()
Dim source As Workbook, dest As Workbook, n%, cellule As Range
On Error Resume Next
Set source = Workbooks("Recupe_Resultat.xlsm") 'à adapter
Set dest = Workbooks("model_prono.xlsm") 'à adapter
If Err Then MsgBox "Les 2 fichiers 'Recupe' et 'model' doivent être ouverts...": Exit Sub
On Error GoTo 0
If source.Worksheets.Count <> dest.Worksheets.Count Then MsgBox "Le nombre des feuilles de calcul n'est pas le même !", 48: Exit Sub
For n = 1 To source.Worksheets.Count
For Each cellule In ActiveSheet.Range("a:a")
If cellule.Value = "*Jeu*" Then
source.Worksheets(n).Range(cellule & ":D62").Copy dest.Worksheets(n).Range("Ay43")
End If
Next
'End If
Next
End Sub |
Partager