Sub repartition3()
Const General = 3 'colonne C
Const M1 = 24 'colonne X
Const M9 = 26 'colonne Z
tabMois = Array("Janvier 11", "Fevrier 11", "Mars 11", "avril 11", "mai 11", "Juin 11", "Juillet 11", "Aout 11", "Septembre 11", "Octobre 11", "Novenbre 11", "Decembre 11") ' ... à suivre
With Sheets("Resultat du TRI")
For Each c In Range("E3:E" & Range("E" & Rows.Count).End(xlUp).Row)
Set cible = Workbooks("CA2011.xls").Sheets(tabMois(Month(c) - 1)).Range("A:A").Find _
(what:=c.Value, LookIn:=xlFormulas, Lookat:=xlWhole)
If Not cible Is Nothing Then
Select Case c.Offset(, 1)
Case "General"
cible.Offset(, General - 1) = c.Offset(, 2)
Case "M 1"
cible.Offset(, M1 - 1) = c.Offset(, 2)
Case "M 9"
cible.Offset(, M9 - 1) = c.Offset(, 2)
End Select
Else
MsgBox "Date non trouvé"
End If
Next c
End With
MsgBox "L'opération s'est déroulé correctement Céline"
End Sub