Re,
Myta, j'ai essayé de faire ce que tu dis, mais surement pas de la bonne façon.
je pensait que la ligne jointe suffirais mais je te joint la macro cette fois-ci (de ta composition).
ComfortablyNumb merci pour ta reponse, mais j'ai deja essayer, ta solution.
Sub Extraire()
Dim Cellule
Sheets("rapport").Select
Range("D2:Y" & Range("B2").End(xlDown).Row).ClearContents
'For Each Cellule In Range("B26:B36")
'For Each Cellule In Range("B2:B" & Range("B2").End(xlDown).Row)
For Each Cellule In Array(Range("B26:B30"), Range("B34:B36"))
With Sheets("hm")
With .Range("D2:D" & .Range("D65536").End(xlUp).Row)
Set cell = .Find(Cellule, LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByColumns) 'xlpart xlwhole
If Not cell Is Nothing Then
Premcell = cell.Address
Do
Select Case cell.Offset(0, -1)
Case "in"
Cellule.Offset(0, 2) = Cellule.Offset(0, 2) + 1
Case "out"
Cellule.Offset(0, 3) = Cellule.Offset(0, 3) + 1
Case "on"
Cellule.Offset(0, 4) = Cellule.Offset(0, 4) + 1
End Select
Set cell = .Cells.FindNext(cell)
Loop Until cell.Address = Premcell
End If
Set cell = Nothing
End With
End With
Next Cellule
'Application.Run "Extraire2"
End Sub
cordialement