```
Function CopyFunction()
Dim lEndRow As Long, lStartRow As Long
Dim num1 As Integer, num2 As Integer
Dim Finals As Worksheet
Set Finals = Worksheets.Add()
Finals.Name = "Payroll Summary"
Range("A1").Value = "ID"
Range("B1").Value = "Sum of Debt"
Range("C1").Value = "Sum of Credit"
'1st row starts from 3
lStartRow = 3
'last row = grand total and its not included
lEndRow = (Sheets("Pivots").Range("A" & Sheets("Pivots").Rows.Count).End(xlUp).Row) - 1
'First loop assingment
For num1 = lStartRow To lEndRow
'Second loop assignment
For num2 = lStartRow To lEndRow
Next
Next
Finals.Columns.AutoFit
End Function
```

I have the above table which now creates the table-to paste the pivot data.

Any help is much appreciated!