Bnsoir à tous,
Version VBA
Option Explicit
Sub pivoter()
Dim a, w(), i As Long, j As Long, n As Long, col As Byte, txt As String, dico As Object
Set dico = CreateObject("Scripting.Dictionary")
dico.comparemode = 1
a = Sheets("feuil1").Range("A1").CurrentRegion.Value
col = UBound(a, 2): n = 1: a(n, 3) = "Ressource_1"
For i = 2 To UBound(a, 1)
txt = Join(Array(a(i, 1), a(i, 2)), Chr(2))
If Not dico.exists(txt) Then
n = n + 1: dico(txt) = VBA.Array(n, col)
For j = 1 To col
a(n, j) = a(i, j)
Next
Else
w = dico(txt): w(1) = w(1) + 1
If UBound(a, 2) < w(1) Then
ReDim Preserve a(1 To UBound(a, 1), 1 To w(1))
End If
a(w(0), w(1)) = a(i, 3)
dico(txt) = w
End If
Next
Application.ScreenUpdating = False
With Sheets.Add().Cells(1).Resize(n, UBound(a, 2))
.Value = a
If UBound(a, 2) > col Then
With .Offset(, 2).Resize(1, 1)
.AutoFill .Resize(, UBound(a, 2) - 2)
End With
End If
.Font.Name = "calibri"
.Font.Size = 10
.VerticalAlignment = xlCenter
.Borders(xlInsideVertical).Weight = xlThin
.BorderAround Weight:=xlThin
With .Rows(1)
.Font.Size = 11
.BorderAround Weight:=xlThin
.Interior.ColorIndex = 43
End With
.Columns.ColumnWidth = 16
End With
Set dico = Nothing
Application.ScreenUpdating = True
End Sub
klin89