Sans vouloir abuser de votre "talent", vous pouvez m'indiquer a quoi correspond chaque ligne en commentaire, ce que ca veut dire en francais
J'essaye d'adapter pour que ca correspond excatement à ce que je veux faire mais je galère terriblement , ...
D'avance, un grand merci !!
[codeSub Recopie()
Dim J As Long
Dim Cel As Range
Dim Depart As String
Dim LigDeb As Long, LigFin As Long
Application.ScreenUpdating = False
With Sheets("Feuil2")
LigDeb = 1
LigFin = .Range("A" & Rows.Count).End(xlUp).Row
' Recherche les limite supérieure : ligne ">-- Nombre d'entreprises déclarant direct (dd) inscrites"
Set Cel = .Columns("A").Find(what:="(dd)", LookIn:=xlValues, lookat:=xlPart)
If Not Cel Is Nothing Then
LigDeb = Cel.Row
End If
' Recherche la limite inférieure : Ligne ">-- Nombre d'entreprises tiers déclarées (td) inscrites"
Set Cel = .Columns("A").Find(what:="(td)", LookIn:=xlValues, lookat:=xlPart)
If Not Cel Is Nothing Then
LigFin = Cel.Row
End If
For J = 5 To Range("A" & Rows.Count).End(xlUp).Row
Set Cel = .Columns("B").Find(what:=Range("A" & J), LookIn:=xlValues, lookat:=xlWhole)
If Not Cel Is Nothing Then
Depart = Cel.Address
Do
' Il faut que le ligne trouvée soit dans les limites
' Et que dans la cellule A la bonne indication
If Cel.Row > LigDeb And Cel.Row < LigFin And _
UCase(Cel.Offset(0, -1)) = UCase("Toutes les entreprises") Then
Range("C" & J) = Cel.Offset(0, 1) * 1
Exit Do
End If
Set Cel = .Columns("B").FindNext(Cel)
Loop While Depart <> Cel.Address
End If
Next J
End With
End Sub][/code]