Sub IMPORTAGCE_CIE()
'
' IMPORTAGCE_CIE Macro
' Macro enregistrée le 16/06/2013 par ROIREC01
'
Dim deb As Range, fin As Range, Quoi As String
With Workbooks("AGCE.xls").Worksheets("ALL_Agent_Source")
Set deb = Nothing: Set fin = Nothing: Quoi = "A5CHIN"
Set deb = .Range("a:a").Find(what:=Quoi, LookIn:=xlValues, lookat:=xlWhole, _
SearchDirection:=xlNext, after:=.Range("a" & .Rows.Count))
If deb Is Nothing Then
MsgBox "Echec! Le terme '" & Quoi & "' n'a pas été trouvé. On passe au terme suivant"
Else
Set fin = .Range("a:a").Find(what:="total", LookIn:=xlValues, lookat:=xlWhole, _
SearchDirection:=xlNext, after:=deb)
If fin Is Nothing Then
MsgBox "Echec! Aucun terme 'Total' d'ici la fin. On passe au terme suivant"
Else
.Range(deb, fin).EntireRow.Copy _
Destination:=ThisWorkbook.Worksheets("Feuil1").Range("A2").EntireRow
End If
End If
Set deb = Nothing: Set fin = Nothing: Quoi = "A5 FIT"
Set deb = .Range("a:a").Find(what:=Quoi, LookIn:=xlValues, lookat:=xlWhole, _
SearchDirection:=xlNext, after:=.Range("a" & .Rows.Count))
If deb Is Nothing Then
MsgBox "Echec! Le terme '" & Quoi & "' n'a pas été trouvé. On passe au terme suivant"
Else
Set fin = .Range("a:a").Find(what:="total", LookIn:=xlValues, lookat:=xlWhole, _
SearchDirection:=xlNext, after:=deb)
If fin Is Nothing Then
MsgBox "Echec! Aucun terme 'Total' d'ici la fin. On passe au terme suivant"
Else
.Range(deb, fin).EntireRow.Copy _
Destination:=ThisWorkbook.Worksheets("Feuil1").Range("A55").EntireRow
End If
End If
End With
End Sub