Hi,
I am trying to import data from an excel file to another using a macro.
The problem is When I paste the values I get the following error: "This operation requires that the cells combine with the same size" (error 1004 runtime)
The macro code is as follows, and the error is given by the line preceded by (*):
Thank you very much in advance.Code:Workbooks.Open Filename: = "L: \ myFile.xls", _ UpdateLinks: = 0 Sheets ( "tab02). Select Range ( "A4: T47"). Select Selection.Copy Windows (MyFile2.xls). Activate Sheets ( "Files"). Select Range ( "A4"). Select Selection.PasteSpecial Paste: = xlFormats, Operation: = xlNone, SkipBlanks: = _ False, Transpose: = False (*) Selection.PasteSpecial Paste: = xlValues, Operation: = xlNone, SkipBlanks: = _ False, Transpose: = False Columns ( "A: A"). EntireColumn.AutoFit


Reply With Quote

Bookmarks