Hello,
I am new to VBA formulas in excel.
I have a workbook with multiple sheets which needs to be copied(only values) in a master sheet in the same workbook. The problem is i get an error on one of my sheets: "Runtime error 1004 : The information cannot be pasted because the Copy area and the paste area are not the same size and shape" . i noticed that this error occurs only if i have only one row in my table that is not blank.
Here is my Formula :
I am new to VBA formulas in excel.
I have a workbook with multiple sheets which needs to be copied(only values) in a master sheet in the same workbook. The problem is i get an error on one of my sheets: "Runtime error 1004 : The information cannot be pasted because the Copy area and the paste area are not the same size and shape" . i noticed that this error occurs only if i have only one row in my table that is not blank.
Here is my Formula :
Code:
Sub MockImportNewData()
Application.ScreenUpdating = False
Sheets("BLUGI").Select
Range("A4:G4").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("MASTER").Select
Range("A3").Select
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Sheets("PANT").Select
Range("A4:G4").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("MASTER").Select
Range("A3").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Sheets("BLUZE").Select
Range("A4:G4").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("MASTER").Select
Range("A3").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Sheets("PULOVER").Select
Range("A4:G4").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("MASTER").Select
Range("A3").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Sheets("FUSTE").Select
Range("A4:G4").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("MASTER").Select
Range("A3").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Sheets("ROCHII").Select
Range("A4:G4").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("MASTER").Select
Range("A3").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Sheets("GECI").Select
Range("A4:G4").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("MASTER").Select
Range("A3").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Sheets("GEANTA").Select
Range("A4:G4").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("MASTER").Select
Range("A3").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Sheets("ACCESORII").Select
Range("A4:G4").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("MASTER").Select
Range("A3").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Sheets("Master").Select
Range("A5").Select
End Sub