Es un poco laborioso lo que pides, basado en el archivo que subiste esta es la macro que ocupas, coloca la tabla transpuesta a partir de la columna j
Option Base 1
Sub EJECUTA()
Application.ScreenUpdating = False
INICIO = Time
CONCATENAR
CREA_TABLA
RELLENA_TABLA
FIN = Time
tiempo = FIN - INICIO
Application.ScreenUpdating = True
MsgBox ("TIEMPO DE PROCESO " & Minute(tiempo) & " minutos:" & Second(tiempo) & " segundos")
End Sub
Sub CONCATENAR()
Dim FUNCION As WorksheetFunction
Set FUNCION = WorksheetFunction
Set DATOS = Range("A1").CurrentRegion
With DATOS
R = .Rows.Count: C = .Columns.Count
Set DATOS = .Rows(2).Resize(R - 1, 3)
Set TABLA = .Columns(C + 1).Resize(R, 1)
matriz = TABLA
ReDim MATRIZ2(3)
For i = 1 To R
fila = .Rows(i)
For j = 1 To 3
MATRIZ2(j) = fila(1, j)
Next j
matriz(i, 1) = Join(MATRIZ2)
Next i
Range(TABLA.Address) = matriz
.CurrentRegion.Name = "DATOS"
End With
Erase matriz
Set TABLA = Nothing: Set DATOS = Nothing
Set FUNCION = Nothing
End Sub
Sub CREA_TABLA()
Dim FUNCION As WorksheetFunction
Set FUNCION = WorksheetFunction
Set DATOS = Range("DATOS")
With DATOS
R = .Rows.Count: C = .Columns.Count
.Sort KEY1:=Range(.Columns(1).Address), ORDER1:=xlAscending, Header:=xlYes
.Columns(C + 3).ClearContents
Set TABLA = .Columns(C + 3).Resize(R, 4)
End With
With TABLA
.Columns(1).Value = DATOS.Columns(C).Value
.Columns(2).Resize(R, 3).Value = DATOS.Columns(1).Resize(R, 3).Value
.RemoveDuplicates Columns:=1
Set TABLA = .CurrentRegion
R1 = .Rows.Count: C1 = .Columns.Count
Set tabla2 = .Columns(C1 + 2).Resize(R, 1)
End With
With tabla2
.Columns(1).Value = DATOS.Columns(4).Value
.RemoveDuplicates Columns:=1
Set tabla2 = .CurrentRegion
R2 = .Rows.Count
matriz = tabla2
.ClearContents
.Cells(1, 0).Resize(1, R2) = FUNCION.Transpose(matriz)
.Columns(0).EntireColumn.Delete
.CurrentRegion.EntireColumn.AutoFit
.CurrentRegion.Name = "TABLA"
End With
Erase matriz
Set TABLA = Nothing: Set DATOS = Nothing: Set tabla2 = Nothing
Set FUNCION = Nothing
End Sub
Sub RELLENA_TABLA()
Dim FUNCION As WorksheetFunction
Set FUNCION = WorksheetFunction
Set TABLA = Range("TABLA")
Set DATOS = Range("DATOS").CurrentRegion
With DATOS
CD = .Columns.Count
End With
With TABLA
R = .Rows.Count - 2: C = .Columns.Count - 4
Set tabla2 = .Cells(2, 5).Resize(R, C)
matriz = tabla2
For i = 1 To R
NOMBRE = .Cells(i, 1)
CUENTA = FUNCION.CountIf(DATOS.Columns(CD), NOMBRE)
If CUENTA = 0 Then GoTo SIG
fila = FUNCION.Match(NOMBRE, DATOS.Columns(CD), 0)
Set info = DATOS.Rows(fila).Resize(CUENTA)
For j = 1 To CUENTA
concepto = info.Cells(j, 4)
Total = info.Cells(j, 5)
fila2 = FUNCION.Match(concepto, tabla2.Rows(0), 0)
matriz(i - 1, fila2) = Total
Next j
SIG:
Next i
With tabla2
Range(.Address) = matriz
.NumberFormat = "0.00"
End With
End With
DATOS.Columns(CD).ClearContents
TABLA.Columns(1).ClearContents
Erase matriz
Set DATOS = Nothing: Set TABLA = Nothing:
Set tabla2 = Nothing: Set FUNCION = Nothing
End Sub