Here is the code and I am getting compile error - Run Time Error 13 - I have made the text bold where I got the issue
Sub r2c()
Sheets("Sheet1").Select
Dim a As Integer
Dim x As Integer
Dim n As Integer
Dim i As Integer
Dim w As Integer
Dim strarray As Variant
Dim lastcol As Long
x = 2
For a = 2 To 4
Sheets("Sheet1").Select
cust = Cells(a, 1).Value
prod = Cells(a, 2).Value
n = 3
Do Until IsEmpty(Cells(a, n))
i = 1
strarray(i) = Cells(a, n).Value
strarray(i + 1) = Cells(a, n + 1).Value
n = n + 2
i = i + 2
Loop
i = 1
w = ((i - 1) / 2 - 1)
Sheets("Sheet2").Select
Cells(x, 1).Value = cust
Cells(x, 2).Value = prod
Cells(x, 3).Value = strarray(i)
Cells(x, 4).Value = strarray(i + 1)
For p = 1 To w
Cells(x + p, 3).Value = strarray(i)
Cells(x + p, 4).Value = strarray(i + 1)
i = i + 1
Next p
x = x + 3
Next a
End Sub
Bookmarks