Hey Akinrontimi. . i tried out the code that you provided however, i was greeted with a run-time error 1004 and if refers to the following line 134 which has this code:
Selection.Insert Shift:=xlToRight
Can someone please take a look and see what the issue is?
Hi,
It worked fine from here.I followed the sample you provided.I took the data in sheet2(rows 8-13) as ideal and thus modified pasted into sheets1,3 and 4 before running the code:
===========================================
Application.ScreenUpdating = False
Sheets("summary").Select
Range("A1").Select
ActiveCell.FormulaR1C1 = "Dates"
Range("a1:g2000").Select
Selection.ClearContents
Sheets("Sheet2").Select
Range("A9:C9").Select
Selection.Copy
Sheets("summary").Select
Range("B7").Select
ActiveSheet.Paste
Selection.Font.Bold = False
Range("a7").Select
ActiveCell.FormulaR1C1 = "Dates"
Range("A2").Select
Sheets("Sheet1").Select
Range("D8").Select
Selection.Copy
Range("D10:D50").Select
ActiveSheet.Paste
Range("C8").Select
Application.CutCopyMode = False
Selection.Copy
Range("D9").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Columns("c:c").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
Range("a3:d50").Select
Selection.Copy
Sheets("summary").Select
Range("a20000").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Sheets("Sheet2").Select
Range("D8").Select
Selection.Copy
Range("D10:D50").Select
ActiveSheet.Paste
Range("C8").Select
Application.CutCopyMode = False
Selection.Copy
Range("D9").Select
ActiveSheet.Paste
Sheets("Sheet2").Select
Columns("c:c").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
Range("a3:d50").Select
Selection.Copy
Sheets("summary").Select
Range("a20000").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Sheets("sheet3").Select
Range("D8").Select
Selection.Copy
Range("D10:D50").Select
ActiveSheet.Paste
Range("C8").Select
Application.CutCopyMode = False
Selection.Copy
Range("D9").Select
ActiveSheet.Paste
Sheets("sheet3").Select
Columns("c:c").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
Range("a3:d50").Select
Selection.Copy
Sheets("summary").Select
Range("a20000").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Sheets("Sheet4").Select
Range("D8").Select
Selection.Copy
Range("D10:D50").Select
ActiveSheet.Paste
Range("C8").Select
Application.CutCopyMode = False
Selection.Copy
Range("D9").Select
ActiveSheet.Paste
Sheets("Sheet4").Select
Columns("c:c").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
Range("a3:d50").Select
Selection.Copy
Sheets("summary").Select
Range("a20000").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Columns("D:D").EntireColumn.AutoFit
Rows("1:1").Select
Selection.Font.Bold = True
Sheets("Sheet2").Select
Range("A1:D50").Select
Selection.Cut Destination:=Range("A8:D57")
Range("D9:D60").Select
Selection.ClearContents
Range("A1").Select
Sheets("Sheet3").Select
Range("A1:D50").Select
Selection.Cut Destination:=Range("A8:D57")
Range("D9:D60").Select
Selection.ClearContents
Range("A1").Select
Sheets("Sheet4").Select
Range("A1:D50").Select
Selection.Cut Destination:=Range("A8:D57")
Range("D9:D60").Select
Selection.ClearContents
Range("A1").Select
Sheets("Sheet1").Select
Range("A1:D50").Select
Selection.Cut Destination:=Range("A8:D57")
Range("D9:D60").Select
Selection.ClearContents
Range("A1").Select
Sheets("summary").Select
Range("A7:D7").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Font.Bold = True
Range("A7").Select
Selection.Cut Destination:=Range("E7")
Range("B7:E7").Select
Selection.Cut Destination:=Range("A7:D7")
Columns("D:D").Select
Selection.Cut
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
Range("A1").Select
Range("A1").Select
Application.ScreenUpdating = True
end sub
========================================
Test and revert please.
Cheers!
Rotimi