Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Unable to copy another spreadsheet to the current spreadsheet with
I turned on the macro recorder on the current spreadsheet and called up
another spreadsheet, selected All, and pasted to the current spreadsheet successfully. When I played back the macro, I got this message: Select Method of Range Class failed: The code is listed below and the error occured at Cells.Select: ChDir "T:\ArchivePandL's" Workbooks.Open Filename:="T:\ArchivePandL's\PL09-05.xls", UpdateLinks:=0 Selection.Copy Windows("BchPerAuto1.xls").Activate ActiveWindow.ScrollWorkbookTabs Position:=xlLast Sheets("Monthly").Select Cells.Select Range("E1").Activate Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Unable to copy another spreadsheet to the current spreadsheet with
rmcompute:
Add a VBA module to your project and add this code to it. Set wbk = Workbooks.Open(Filename:="T:\ArchivePandL's\PL09-05.xls", UpdateLinks:=0) 'PL09-05.xls if copy Sheet1!A1:10 wbk.Sheets("Sheet1").Range("A1:A10").Copy With ThisWorkbook.Sheets("Monthly").Range("E1") .PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False .PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Application.CutCopyMode = False -- 天行健,君*以自強不息 地勢坤,君*以厚德載物 http://www.vba.com.tw/plog/ "rmcompute" wrote: I turned on the macro recorder on the current spreadsheet and called up another spreadsheet, selected All, and pasted to the current spreadsheet successfully. When I played back the macro, I got this message: Select Method of Range Class failed: The code is listed below and the error occured at Cells.Select: ChDir "T:\ArchivePandL's" Workbooks.Open Filename:="T:\ArchivePandL's\PL09-05.xls", UpdateLinks:=0 Selection.Copy Windows("BchPerAuto1.xls").Activate ActiveWindow.ScrollWorkbookTabs Position:=xlLast Sheets("Monthly").Select Cells.Select Range("E1").Activate Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Unable to copy another spreadsheet to the current spreadsheet
It worked.
Thank you. "chijanzen" wrote: rmcompute: Add a VBA module to your project and add this code to it. Set wbk = Workbooks.Open(Filename:="T:\ArchivePandL's\PL09-05.xls", UpdateLinks:=0) 'PL09-05.xls if copy Sheet1!A1:10 wbk.Sheets("Sheet1").Range("A1:A10").Copy With ThisWorkbook.Sheets("Monthly").Range("E1") .PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False .PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Application.CutCopyMode = False -- 天行健,君*以自強不息 地勢坤,君*以厚德載物 http://www.vba.com.tw/plog/ "rmcompute" wrote: I turned on the macro recorder on the current spreadsheet and called up another spreadsheet, selected All, and pasted to the current spreadsheet successfully. When I played back the macro, I got this message: Select Method of Range Class failed: The code is listed below and the error occured at Cells.Select: ChDir "T:\ArchivePandL's" Workbooks.Open Filename:="T:\ArchivePandL's\PL09-05.xls", UpdateLinks:=0 Selection.Copy Windows("BchPerAuto1.xls").Activate ActiveWindow.ScrollWorkbookTabs Position:=xlLast Sheets("Monthly").Select Cells.Select Range("E1").Activate Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Inserting part of a Spreadsheet into the Current Spreadsheet | Excel Discussion (Misc queries) | |||
Macro to copy and append spreadsheet changes to new spreadsheet | Excel Discussion (Misc queries) | |||
How do I copy spreadsheet data as shown to another spreadsheet? | Excel Discussion (Misc queries) | |||
In Excel I want to copy text from spreadsheet to spreadsheet | Excel Worksheet Functions | |||
How to open another Excel spreadsheet to copy data into current spreadsheet ? | Excel Programming |