Sub recap_publipostage()
Set shr = Sheets("recap")
Set shp = Sheets("publi")
derL2 = shr.Cells(Rows.Count, 1).End(3).Row
derL2R = shp.Cells(Rows.Count, 1).End(3).Row
j = 11
shp.Select
Range(Cells(2, 1), Cells(derL2R + 1, 100)).ClearContents
derL2R = shp.Cells(Rows.Count, 1).End(3).Row
shr.Select
For i = 2 To derL2
On Error GoTo prochain
'If Not IsError(CLng(Cells(i, 7).Value)) Then
If CLng(Cells(i, 14).Value) > 0 Then
If Cells(i, 3).Value <> Cells(i - 1, 3).Value Then
shr.Range(Cells(i, 1), Cells(i, 13)).Copy Destination:=shp.Cells(derL2R + 1, 1)
Else
If shp.Cells(derL2R + 1, 3) = shr.Cells(i, 3) Then
j = j + 3
shr.Range(Cells(i, 11), Cells(i, 13)).Copy Destination:=shp.Cells(derL2R + 1, j)
Else
shr.Range(Cells(i, 1), Cells(i, 13)).Copy Destination:=shp.Cells(derL2R + 1, 1)
End If
End If
End If
If Cells(i, 3).Value <> Cells(i + 1, 3).Value Then derL2R = shp.Cells(Rows.Count, 1).End(3).Row: j = 11
prochain:
On Error GoTo -1
Next i
shp.Select
[A1].CurrentRegion.borders.LineStyle = xlNone
End Sub