Option Explicit
Sub Liste_Dessin()
Dim f As Worksheet, TblBD(), CelDepart As Range, d1 As Object, d2 As Object, i As Integer
Dim clé1, clé2, lig As Long, col As Integer
Set f = ThisWorkbook.Sheets("liste vers dessin")
TblBD = f.Range("b4:d" & f.Range("b" & Rows.Count).End(xlUp).Row).Value
Set CelDepart = f.Range("h13") ' Adresse résultat
Set d1 = CreateObject("Scripting.Dictionary")
Set d2 = CreateObject("Scripting.Dictionary")
Dim TblRes(1 To 100, 1 To 100)
For i = LBound(TblBD) To UBound(TblBD)
clé1 = TblBD(i, 1): If d1.exists(clé1) Then lig = d1(clé1) Else d1(clé1) = d1.Count + 1: lig = d1.Count
clé2 = TblBD(i, 2): If d2.exists(clé2) Then col = d2(clé2) Else d2(clé2) = d2.Count + 1: col = d2.Count
TblRes(lig, col) = TblBD(i, 3)
Next i
CelDepart.Offset(1).Resize(d1.Count, 1) = Application.Transpose(d1.keys) ' titre lignes
CelDepart.Offset(, 1).Resize(1, d2.Count) = d2.keys ' titres colonnes
CelDepart.Offset(1, 1).Resize(d1.Count, d2.Count) = TblRes ' résultat
Set CelDepart = Nothing
Set d1 = Nothing
Set d2 = Nothing
End Sub
Sub Dessin_Liste()
Dim f As Worksheet, CelDepart As Range, TblE, n As Long, ligne As Long, col As Integer
Set f = Sheets("dessin vers liste")
Set CelDepart = f.Range("b4")
TblE = f.[i3].CurrentRegion
Dim TblS(): ReDim TblS(1 To UBound(TblE) * UBound(TblE, 2), 1 To 3)
n = 0
For ligne = 2 To UBound(TblE, 1)
For col = 2 To UBound(TblE, 2)
If TblE(ligne, col) <> "" Then
n = n + 1
TblS(n, 1) = TblE(ligne, 1)
TblS(n, 2) = TblE(1, col)
TblS(n, 3) = TblE(ligne, col)
End If
Next col
Next ligne
f.Range("b4:d" & f.Range("b" & Rows.Count).End(xlUp).Row).ClearContents
CelDepart.Resize(n, 3) = TblS
End Sub