xlApp.Sheets("Sheet2").Select
xlApp.ActiveSheet.Range("A1").Select
xlApp.ActiveCell.Offset(2, 0).Cells.Select
xlApp.ActiveCell.CopyFromRecordset RsProj
xlApp.ActiveSheet.Range("N1").Select
xlApp.ActiveCell.Offset(2, 0).Cells.Select
xlApp.ActiveCell.CopyFromRecordset RsDebits
xlApp.ActiveSheet.Range("A1:N70").Select
xlApp.Selection.Copy
xlApp.Sheets("Sheet1").Select
xlApp.ActiveSheet.Range("A30").Select
xlApp.Selection.End(xlDown).Select
xlApp.ActiveCell.Offset(2, 0).EntireRow.Select
xlApp.ActiveSheet.Paste
xlApp.Sheets("Sheet2").Select
xlApp.ActiveWindow.SelectedSheets.Delete
xlApp.Sheets("Sheet3").Select
xlApp.ActiveSheet.Range("A1:N10").Select
xlApp.Selection.Copy
xlApp.Sheets("Sheet1").Select
xlApp.ActiveSheet.Range("N29").Select
xlApp.Selection.End(xlDown).Select
xlApp.ActiveCell.Offset(3, 0).EntireRow.Select
xlApp.Selection.End(xlToRight).Select
xlApp.Selection.End(xlDown).Select
xlApp.ActiveCell.Offset(4, 0).EntireRow.Select
xlApp.Selection.End(xlToLeft).Select
xlApp.ActiveSheet.Paste
xlApp.ActiveSheet.Range("N29").Select
xlApp.Selection.End(xlDown).Select
xlApp.ActiveCell.Offset(3, 0).EntireRow.Select
xlApp.Selection.End(xlToRight).Select
xlApp.Selection.End(xlDown).Select
xlApp.ActiveCell.Offset(4, 0).Cells.Select
r = xlApp.ActiveCell.Select
xlApp.ActiveCell.Formula = "=SUM(N30:N" & r - 1 & ")"
xlApp.ActiveSheet.Range("A1").Select
xlApp.ActiveCell.Offset(2, 0).Cells.Select
xlApp.ActiveCell.CopyFromRecordset RsProj
xlApp.ActiveSheet.Range("N1").Select
xlApp.ActiveCell.Offset(2, 0).Cells.Select
xlApp.ActiveCell.CopyFromRecordset RsDebits
xlApp.ActiveSheet.Range("A1:N70").Select
xlApp.Selection.Copy
xlApp.Sheets("Sheet1").Select
xlApp.ActiveSheet.Range("A30").Select
xlApp.Selection.End(xlDown).Select
xlApp.ActiveCell.Offset(2, 0).EntireRow.Select
xlApp.ActiveSheet.Paste
xlApp.Sheets("Sheet2").Select
xlApp.ActiveWindow.SelectedSheets.Delete
xlApp.Sheets("Sheet3").Select
xlApp.ActiveSheet.Range("A1:N10").Select
xlApp.Selection.Copy
xlApp.Sheets("Sheet1").Select
xlApp.ActiveSheet.Range("N29").Select
xlApp.Selection.End(xlDown).Select
xlApp.ActiveCell.Offset(3, 0).EntireRow.Select
xlApp.Selection.End(xlToRight).Select
xlApp.Selection.End(xlDown).Select
xlApp.ActiveCell.Offset(4, 0).EntireRow.Select
xlApp.Selection.End(xlToLeft).Select
xlApp.ActiveSheet.Paste
xlApp.ActiveSheet.Range("N29").Select
xlApp.Selection.End(xlDown).Select
xlApp.ActiveCell.Offset(3, 0).EntireRow.Select
xlApp.Selection.End(xlToRight).Select
xlApp.Selection.End(xlDown).Select
xlApp.ActiveCell.Offset(4, 0).Cells.Select
r = xlApp.ActiveCell.Select
xlApp.ActiveCell.Formula = "=SUM(N30:N" & r - 1 & ")"