Eu escrevi um código, por favor tente:
Option Explicit
Public Sub customePivot()
Call makePivot(Sheets("Sheet1"), Sheets("Sheet2"))
End Sub
Private Sub makePivot(sourceWs As Worksheet, DestWs As Worksheet, Optional startRow As Long = 2)
Dim i As Long, j As Integer, k As Integer, lastRow As Long
Dim strTemp As String
lastRow = startRow
For i = startRow To sourceWs.Rows.Count
strTemp = Trim(sourceWs.Cells(i, 1).Value & "")
If (strTemp = "") Then Exit For
'
If (Val(sourceWs.Cells(i, 4).Value & "") <> 0) Or (Val(sourceWs.Cells(i, 7).Value & "") <> 0) Then
For j = 1 To 3
For k = 1 To 3
Call addNewRow(DestWs, lastRow, _
(sourceWs.Cells(i, 1).Value & ""), (sourceWs.Cells(i, 2).Value & ""), (sourceWs.Cells(i, 3).Value & ""), _
(sourceWs.Cells(1, 3 + j).Value & ""), (sourceWs.Cells(1, 6 + k).Value & ""), _
(sourceWs.Cells(i, 3 + j).Value & ""), (sourceWs.Cells(i, 6 + k).Value & ""))
lastRow = lastRow + 1
Next k
Next j
End If
Next i
End Sub
Private Sub addNewRow(ws As Worksheet, inRow As Long _
, productI As String, currencyI As String, valueI As String _
, regionI As String, CustomerI As String _
, valu2 As String, value3 As String)
'
ws.Cells(inRow, 1).Value = productI
ws.Cells(inRow, 2).Value = currencyI
ws.Cells(inRow, 3).Value = valueI
ws.Cells(inRow, 4).Value = regionI
ws.Cells(inRow, 5).Value = CustomerI
ws.Cells(inRow, 6).Value = valu2
ws.Cells(inRow, 7).Value = value3
End Sub