Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have this code that is suppose to open the file copy all its content and then paste it in the file the code is in. But the code has an erro (see below) Sub CombineFiles() Range("A1").Select MyBook = ActiveWorkbook.Name MyTargetCell = ActiveCell.Address MySource = Application.GetOpenFilename Workbooks.Open Filename:=MySource Range("A1").Select Set MyRange = Range(Selection ActiveCell.SpecialCells(xlLastCell)).Selec <--------------------------------- error: type mismatch MyRange.Copy ActiveWorkbook.Close Workbooks(MyBook).Activate Range(MyTargetCell).Select ActiveSheet.Paste ActiveWorkbook.SaveAs MySource End Su -- tim6 ----------------------------------------------------------------------- tim64's Profile: http://www.excelforum.com/member.php...fo&userid=2329 View this thread: http://www.excelforum.com/showthread.php?threadid=38459 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Paste Link not copying hyperlinks | Excel Discussion (Misc queries) | |||
Copy, paste without file name referenced after paste | Excel Discussion (Misc queries) | |||
how to repeat a paste of cells without copying again | Excel Discussion (Misc queries) | |||
Copying of cell text from one file to paste as cell comments in a 2nd file | Excel Programming | |||
Selecting ranges to copying and Paste | Excel Programming |