Try this code
Option Explicit
Sub transpose()
Dim ws As Worksheet
Dim lrow As Long, i As Long, a As Long
Set ws = Worksheets("Sheet2")
With Worksheets("Sheet1")
lrow = .Range("A" & .Rows.Count).End(xlUp).Row
ws.Range("A1:D1").Value = Split("Customer,Head,Month,Amount", ",")
For i = 2 To lrow
a = ws.Range("A" & .Rows.Count).End(xlUp).Row
ws.Range("A" & a + 1).Value = .Range("A" & i).Value
.Range("B" & i & ":D" & i).Copy ws.Range("B" & a + 1)
a = a + 1
ws.Range("A" & a + 1).Value = .Range("A" & i).Value
.Range("E" & i & ":G" & i).Copy ws.Range("B" & a + 1)
a = a + 1
ws.Range("A" & a + 1).Value = .Range("A" & i).Value
.Range("H" & i & ":J" & i).Copy ws.Range("B" & a + 1)
Next i
End With
End Sub
Copy the Excel VBA code
Select the workbook in which you want to store the Excel VBA code
Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
Choose Insert | Module
Where the cursor is flashing, choose Edit | Paste
To run the Excel VBA code:
Choose View | Macros
Select a macro in the list, and click the Run button
Bookmarks